Jump to content

Remote Data and HTTP Response


Shymus Roffo
 Share

You are about to reply to a thread that has been inactive for 4359 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

i have been experimenting with these two events and wondering if there are better alternatives to remote data with PHP functions... I am begining to learn php and i do not know how to send http requests and wanted to know how to do it...XML-RPC is a pain to figure out and remember.. If you can please help.

Link to comment
Share on other sites


shymus Roffo wrote:

How can i figure out what ports are avaliable to me from the hosting company? do i have to contact the company or can i just use phpinfo() ?

 

You can just try your code and if you think it will work see what happens, or you could just ask the hosting company if they restrict outbound connections on ports other than port 80 (or any others)

Link to comment
Share on other sites

Actually, there are at least 3 points of failure:

  • fsock isn't enabled - you can see that in the phpinfo() 
  • the port is blocked - the request will time out
  • you provided a wrong url for the LSL script in your php script - you'll get an error message in the webpage (in the example I pointed to) that the cap wasn't found. This at least means, the port is open
Link to comment
Share on other sites

Darkie now raises another fun point and that's when a prim with a script gets a URL, that URL is valid until the script resets or the object is re-rezzed OR the region restarts.

Region restarts need to be handled if you expect your web host to send data to the inworld prim at any point as it will need a current URL.

Similarly, if the prim happens to be a worn item such as a hud, you'll need to handle the rez situation on region change or teleport.

It's all fun!

Link to comment
Share on other sites

Ah well in that case, you might be able to be a bit clever and not get into difficulty with initiating outbound communications.

Depending on how you do it, your web browser can make the request to the inworld delivery server and that won't have any ports restricted.  You would need to have appropriate security controls in place though with this model to avoid any vulnerabilities that permitted someone to run local scripts in a browser that then commanded a delivery server to hand out free products and i'm not saying it's the best model, just something that you *might* be able to work with if blocked ports is an issue.

Link to comment
Share on other sites

if you need to work around the changing URL that Sassy pointed out a couple of posts ago, there is a workaround I posted in this thread about using a third party service to keep the location of your inworld prim up to date.  Not sure it would be needed in your case since the inworld server communicates to the out of world server first if I am following correctly.  But just in case there it is.

Link to comment
Share on other sites

If it's a vending solution then at some point it will be making a call from the webhost to the inworld delivery server.  Given that it only has to communicate with those (by the sound of it), there's only a need to maintain a sql table of a handful of delivery servers so shouldn't be a problem to update those when the URL changes.  There'll be a database anyway so all good as far as I can see.

Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 4359 days.

Please take a moment to consider if this thread is worth bumping.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...