Jump to content

Http request issues


Shihan Feiri
 Share

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

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

Recommended Posts

Hi there, ii have one question in general

I have script that send data of owner of product via llHttpRequest to database ( user pages ).

 

Now, php file work fine. just i have problem that script dont post data from first request. So I need to click twice to send same request. It is one state, and for test purpose I send my key. 

I have notice if I write llHttpRequest twice, one after another then script work fine. I think thats not solution, so I wonder if someone in past have similar problems. 

Link to comment
Share on other sites

Ok, this is way that i make that

key http_status_update;

 

default...

state_entry(){

string http_body =
llEscapeURL("name_of colum xx in database") +"="+ llEscapeURL((string)some string)+"&"+
llEscapeURL("name of colum xy in database ") +"="+ llEscapeURL((string)some another string)
;

http_status_update = llHTTPRequest(PHP_url, [HTTP_METHOD,"POST",HTTP_MIMETYPE,"application/x-www-form-urlencoded"], http_body);

}....

Now with one http_status update is not working . If i write it twice then will work eg.

 

http_status_update = llHTTPRequest(PHP_url, [HTTP_METHOD,"POST",HTTP_MIMETYPE,"application/x-www-form-urlencoded"], http_body);

 

http_status_update = llHTTPRequest(PHP_url, [HTTP_METHOD,"POST",HTTP_MIMETYPE,"application/x-www-form-urlencoded"], http_body);

 

I'm realy puzzled now

Link to comment
Share on other sites

I can't see why it shouldn't work. I guess you have to track down the reason step by step. I would start by sending a very simple http_request that makes a very simple php script respond with a very simple anser. If that works, keep on adding a little more complexity until the error occurs.

Link to comment
Share on other sites

You don't need it.

If you use the event, it helps you to see if the php is triggered - something like:

key http_status_update; default {state_entry(){	string http_body = "test=mytest";		http_status_update = llHTTPRequest(PHP_url, [HTTP_METHOD,"POST",HTTP_MIMETYPE,"application/x-www-form-urlencoded"], http_body);	}		http_response(key request_id, integer status, list metadata, string body) {		llOwnerSay(body);	}}

And a php script like:

<?php   echo &_POST['test'];?>

 

Link to comment
Share on other sites

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

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...