Author Topic: PHP code question  (Read 440 times)

Are you able to have communication between PHP and TorqueScript?

If so, how, I have been sending requests to the server with the PHP on it, and it gives me a "Bad request" error on the TorqueScript side.
« Last Edit: February 12, 2014, 04:15:42 PM by Advanced Bot »

Did you try restarting your computer.

Did you try restarting your computer.
It isn't my computer.

I am talking about communication between PHP and TorqueScript.

All you gotta do is just go with it.

PHP:
Code: [Select]
<?php
   
echo($_GET["message"]);
?>


TQS:
Code: [Select]
function phpObject::onLine(%this, %line)
{
    if(%this.echoNow)
        echo(%line);
    if(%line $= "")
        %this.echoNow = true;
}

function phpObject::onConnected(%this, %addrip)
{
    %this.echoNow = false;
}

%php = new tcpObject(phpObject);
%php.connect("127.0.0.1:80");
%php.send("GET /yourPage.php?message=Hello HTTP/1.0\r\nHost: 127.0.0.1\r\n\r\n");

Also, coding help yo.

It isn't my computer.

I am talking about communication between PHP and TorqueScript.
I know, I was joking.