Jump to content

CodeIgniter with SecondLife Scripting


max_w1

Recommended Posts

Hi everyone,

I am trying to Post some data from second life using the secondlife function called llHTTPRequest() i am able to get it work normally(without using codeigniter) by just using the $_POST[] method.

 

my lsl script is something like this:

 string parameters = "userkey="+myuserkey+"&username="+myusername;

           myRequest = llHTTPRequest("http://www.lespectra.com/tl_test.php",[HTTP_METHOD, "POST",HTTP_MIMETYPE, "application/x-www-form-urlencoded"],parameters); 

 

this script returns value like http://www.lespectra.com/tl_test.php?userkey=01&username=something  (secondlife sends this value to my webpage using the POST method, hence i am able to retrieve the value by using the $_POST)

 

Now the tough part comes, how do i do it using CodeIgniter?

i tried to change my secondlfe script to:

 string parameters = "userkey/"+myuserkey+"/username/"+myusername;

           myRequest = llHTTPRequest("http://www.lespectra.com/tl/index.php/site/myfunction/",[HTTP_METHOD, "POST",HTTP_MIMETYPE, "application/x-www-form-urlencoded"],parameters); 

 

i assume this should return value like http:www.lespectra.com/tl/index.php/site/myfunction/userkey/01/username/someting

even if it returns this value which i am expecting i cannot use the uri_segment() function in codeigniter because the value is in POST. i cannot even use the $this->input->post() content because the $this->input->post() expects data to be in " ?info=value " format not in " info/value " format.

 

Does this mean i cannot use codigniter for this project?

 

 

Link to comment
https://forums.phpfreaks.com/topic/242108-codeigniter-with-secondlife-scripting/
Share on other sites

Solved it!

just had to change

string parameters = "userkey/"+myuserkey+"/username/"+myusername;

 

          myRequest = llHTTPRequest("http://www.lespectra.com/tl/index.php/site/myfunction/",[HTTP_METHOD, "POST",HTTP_MIMETYPE, "application/x-www-form-urlencoded"],parameters);

 

to

string parameters = "userkey="+myuserkey+"&username="+myusername;

 

          myRequest = llHTTPRequest("http://www.lespectra.com/tl/index.php/site/myfunction/",[HTTP_METHOD, "POST",HTTP_MIMETYPE, "application/x-www-form-urlencoded"],parameters);

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.