when i use php curl to send my post commands to sl it works fine from my local machine but when i try it from hostgator i get nothing.
no error no nothing just a blank page
PROBLEM SOLVED
I have performed the required modifications to your account:
- You had to be added to the 'get' users group (GET, WGET and cURL calls all fall within the same category)
- A modification to the outbound filter of the firewall had to be made (add port 12046) to allow the outbound post.
CODE
$ch = curl_init(url);
curl_setopt ($ch, CURLOPT_POST, 1);
curl_setopt ($ch, CURLOPT_POSTFIELDS, "test=result");
$html = curl_exec ($ch);
curl_close ($ch);
print_r($html);
CODE
http_request(key id, string method, string body) {
list incomingMessage;
if ((method == URL_REQUEST_GRANTED) && (id == requestURL) ){
// An URL has been assigned to me.
llOwnerSay("Obtained URL: " + body);
updateurl(servername,body);//update the server url
requestURL = NULL_KEY;
}
else if ((method == URL_REQUEST_DENIED) && (id == requestURL)) {
// I could not obtain a URL
llOwnerSay("There was a problem, and an URL was not assigned: " +
body);
requestURL = NULL_KEY;
}
else if (method == "POST") {
// An incoming message was received.
llOwnerSay("Received information form the outside: " + body);
incomingMessage = parsePostData(body);
llOwnerSay(llDumpList2String(incomingMessage,"\n"));
llHTTPResponse(id,200,"You passed the following:\n" +
llDumpList2String(incomingMessage,"\n"));
}
else {
// An incoming message has come in using a method that has
// not been anticipated.
llHTTPResponse(id,405,"Unsupported Method");
}
}
