Jump to content

New Help With LSL to PHP Script


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

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

Recommended Posts

I have this script which connects to a PHP script which then connects to a data base. the script looks as such

toWebPage(string params)
{
    params += "&FromSL=true";
    string tst = "";
    if(DEBUG)
    {
        tst = "/tst";
    }
    llDebugSay("HTTP REQUEST: " + URL + PRODUCTNAME + tst+"/"+controller+".php");
    llDebugSay("HTTP REQUEST: " + params);
    myRequest = llHTTPRequest(URL + PRODUCTNAME + tst + "/"+controller+".php",
      [HTTP_METHOD, "POST",
       HTTP_MIMETYPE, "application/x-www-form-urlencoded"],
       params);
}

The method runs perfect as I have been using it for weeks, however, in the last couple of days it has just stopped working. The code is the same on both LSL and PHP. If I run the PHP script from a browser passing in the same params it works perfectly. If I get SL to send the info to the PHP script I get this returned

<HTML><HEAD>
<TITLE>Internal Server Error</TITLE>
</HEAD><BODY>
<H1>Internal Server Error - Read</H1>
The server encountered an internal error or misconfiguration and was unable to
complete your request.<P>
Reference&#32;&#35;3&#46;9d55ee3f&#46;1515566038&#46;54729c
</BODY></HTML>

I don't even know where to begin with debugging this because it works server side, just not SL side and they are using the exact same params and url????

Link to post
Share on other sites
15 hours ago, Sigh Parx said:

Internal Server Error...

Reference&#32;&#35;3&#46;9d55ee3f&#46;1515566038&#46;54729c

The error means the server, probably Apache, found a program to execute for that URL, and that program crashed.

Note that if you're going to pass info around in encoded URL format, you're supposed to encode it first. See http://wiki.secondlife.com/wiki/LlEscapeURL for how. This matters if there are spaces or special characters in the content. LL says they recently changed handling of spaces in URLs, so check that.

The PHP side working from a browser indicates this is likely the problem. Browsers will do that encoding for you. If you type in or paste in a URL with a space, it will be converted to "%20". But in LSL, you have to make function call to do that.

Link to post
Share on other sites

Thanks for the reply guys, I will look into that.

EDIT:

Upon writing a reply on the other forum post, I had to get some examples from the script and it ran find today. It hasn't ran fine for about a month and today, with no changes, it decides to start working again.

¬¬

Edited by Sigh Parx
Link to post
Share on other sites
You are about to reply to a thread that has been inactive for 1113 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
×
×
  • Create New...