I am trying to make a php page I can send simple object uuids too. For testig I made a prim with this inside integer SECRET_NUMBER=69; string SECRET_STRING="**bleep**"; key http_request_id; list uu; xrequest(string url, list l) { integer i; string body; integer len=llGetListLength(l) & 0xFFFE; // make it even for (i=0;i<len;i+=2) { string varname=llList2String(l,i); string varvalue=llList2String(l,i + 1); if (i>0) body+="&"; body+=llEscapeURL(varname)+"="+llEscapeURL(varvalue); } string hash=llMD5String(body+llEscapeURL(SECRET_STRING),SECRET_NUMBER); http_request_id = llHTTPRequest(url+"?hash="+hash,[HTTP_METHOD,"POST",HTTP_MIMETYPE,"application/x-www-form-urlencoded"],body); } default { state_entry() { } touch_start(integer total_number) { xrequest(" site url",["testpage.php",123,"test","2"]); } } I Edit the site url as I do not want any one to see the location atm . I used this file in my severs main html folder where i store my normal site info. <?php
// this function tweak slightly urlencode to make it behave exactly like llEscapeURL in Second Life.
function llEscapeURL($s)
{
$s=str_replace(
array(" ","+","-",".","_"),
array("%20","%20","%2D","%2E","%5F"),
urlencode($s));
return $s;
}
// this my main SL page XML-RPC page
function checkHash()
{
global $body;
$hash=$_GET["hash"];
$body="";
$cpt=0;
$SECRET_NUMBER=123456789;
$SECRET_STRING="abcdefghi";
foreach ($_POST as $name => $value) {
if ($cpt++>0) $body.="&";
if (get_magic_quotes_gpc()) {
// $name = stripslashes($name); not a good idea though
$value = stripslashes($value);
$_POST[$name]=$value;
}
$body.=llEscapeURL($name)."=".llEscapeURL($value);
}
$calcHash=md5($body.$SECRET_STRING.':'.$SECRET_NUMBER);
if ($hash!=$calcHash)
{
sleep(2); // slow down the requests
echo "result=FAIL\nMSG=Invalid request.";
die;
}
}
checkHash();
// You can use the parameters here by simply using $_POST["parameter_name"]
echo "OK";
?>