Jump to content

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);

 

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.