Well, if the title wasn’t clear enough, I need help with a script I am creating. I am new to socket aspects of life, expecially for PHP, but need to edit my already working application to use a post method instead of a get. It will eventually be used to show account information from an offsite database when queried, and as it may be sending secure material between the 2 I don’t want to have it using the URL to store its information.
Here is the script at the moment
[COLOR=#000000]http://www.reigninggames.com/tests/socketTest.php[/COLOR]
And if you wish to see the source code here you can do that:
http://www.reigninggames.com/tests/socketTest.php?hl
Basically I have this code:
<?php
if(count($_GET)) {
highlight_file(__FILE__);
echo"<br><br>";
}
$SendVar = "now";
function getVersion($Send) {
$host = 'threeskulls.th.funpic.org';
$fp = fsockopen($host, 80, &$errno, &$errstr, 8);
if (!$fp) {
return "Unable to connect to {$host}";
}
else {
$request = "GET /tv2.php?find=$Send HTTP/1.0
"
."Host: $host
"
."Connection: close
";
fputs($fp, $request);
while (!feof($fp)){
$response .= fgets($fp, 1024);
}
fclose($fp);
if(strstr($response, ':')){
// $response = explode("time:", $response);
// return 'Testing: ' . $response['1'];
return $response;
}
return "Unable to find output on {$host}";
}
}
echo getVersion($SendVar);
?>
and I need to change the communication method to POST, but can’t get it to work with what I have tried.
It will be making queries on the offsite page to a mysql database so I can’t just have the contents of the file included, but need them to finsih their functions and send back the results.
Any help would be great.