Linden Scripting Language发布到PHP

时间:2014-10-31 01:59:49

标签: linden-scripting-language

当我使用Linden Scripting LanguageLlHTTPRequest脚本向PHP发送请求时,我没有在PHP中获取值:

示例:(LSL)

if(group_invite == "yes")
{

    list agents = llParseString2List(this_agent_name, [" "], []);

    string params = llDumpList2String([
        "firstname=" + llList2String(agents, 0),
        "lastname=" + llList2String(agents, 1)],
        "&");

    llHTTPRequest(
        "http://mysite/post-page.php",
        [HTTP_METHOD,"POST"],
        params);
}

我从未获得firstnamelastname值。

1 个答案:

答案 0 :(得分:1)

要在POST请求中以该格式提交参数,您的请求必须将Content-Type标头设置为application/x-www-form-urlencoded

llHttpRequest(
    "http://example.com/post-page.php",
    [HTTP_METHOD, "POST", HTTP_MIMETYPE, "application/x-www-form-urlencoded"],
    params);