Hey everyone,
In school I am studying "Digital Virtual Environments" and for my final project I did not want to create some gay machinima video or some goole earth tour, I want to create some sort of portal from the real world do the digital virtual world.
I have seen the example about second life in the cookbook and I just have one problem. The PHP code at the end of the page seems to return a syntax error "Parse error: syntax error, unexpected '{' in /home/myrtahos/public_html/mbed.php on line 12"
I do not have much experience with php so I was wondering if anyone could spot the error, or help me fix this.
Thanks for all your help.
<?php
$channel = $_REQUEST["channel"]; // e.g. e3de9c3d-0dae-5125-b655-94d0bf05134a
$data = $_REQUEST["data"];
$xmldata = "<?xml version=\"1.0\"?><methodCall><methodName>llRemoteData</methodName><params><param><value><struct><member><name>Channel</name><value>\
<string>".$channel."</string></value></member><member><name>IntValue</name><value><int>0</int></value></member><member><name>StringValue</name><value>\
<string>".$data."</string></value></member></struct></value></param></params></methodCall>";
$host = "xmlrpc.secondlife.com";
$path = "/cgi-bin/xmlrpc.cgi";
if(!($fp = fsockopen($host, 80, $errno, $errstr, 30)) {
print("Could not connect");
exit();
}
fputs($fp, "POST $path HTTP/1.1\r\n");
fputs($fp, "Host: $host\r\n");
fputs($fp, "Content-type: text/xml\r\n");
fputs($fp, "Content-length: " . strlen($xmldata) . "\r\n");
fputs($fp, "Connection: close\r\n\r\n");
fputs($fp, $xmldata);
echo "<pre>";
while (!feof($fp)) {
echo fgets($fp,1024);
}
echo "</pre>";
fclose($fp);
?>
Hey everyone,
In school I am studying "Digital Virtual Environments" and for my final project I did not want to create some gay machinima video or some goole earth tour, I want to create some sort of portal from the real world do the digital virtual world.
I have seen the example about second life in the cookbook and I just have one problem. The PHP code at the end of the page seems to return a syntax error "Parse error: syntax error, unexpected '{' in /home/myrtahos/public_html/mbed.php on line 12"
I do not have much experience with php so I was wondering if anyone could spot the error, or help me fix this.
Thanks for all your help.