Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

plz help http_request working from localhost not from server

James Papp
Registered User
Join date: 13 Feb 2007
Posts: 10
07-26-2009 05:15
im messing with http with no sucess.
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

From: someone

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");
}
}
Rygel Ryba
Registered User
Join date: 12 Feb 2008
Posts: 254
07-26-2009 05:30
It's been a hundred years since I dealt with any of this, but... I glanced and saw some calls to CURL. Back in the day that was turned off by default on most hosts. Are you certain it's installed and turned on on your remote server?
James Papp
Registered User
Join date: 13 Feb 2007
Posts: 10
07-26-2009 05:45
ya i run a number of scraper sites from the same account.
i just tested a curl to lindenlabs.com on port 80 and it workd so im guessing that hostgator are blocking any outgoing connections not on port 80 :(
I think ill have to contact them about it
Rygel Ryba
Registered User
Join date: 12 Feb 2008
Posts: 254
07-26-2009 06:19
yep. That's probably it - port blockades.