Hodo33 Posted November 26, 2019 Share Posted November 26, 2019 This has worked for me in the past and copy/paste to a new app now it does not work. gameone.php exists on the server, just simple code to write to a text file%data = "code="@$TCPCode @ "&sname="@%sname @ "&wmis="@%mission; %httpCmd="POST /game/gameone.php HTTP/1.1\nHost: www.myweb.com:80\nUser-Agent: Torque/1.0 \nAccept: */*\nContent-Length: "@ strlen(%data) @"\nContent-Type: application/x-www-form-urlencoded; charset=UTF-8\n\n" @ %data; %this.send(%httpCmd @ " \r\n");function TCPObj::onLine(%this, %line){ echo("TCP LINE "@%line); // returns HTTP/1.1 400 Bad Request}Anyone know if things have changed since 1.5.2 ? Quote Link to comment Share on other sites More sharing options...
Hodo33 Posted December 4, 2019 Author Share Posted December 4, 2019 Bump ... any ideas on this ?I have a good system for messaging game activity if I can get this working and willing to share..... Quote Link to comment Share on other sites More sharing options...
Bloodknight Posted December 5, 2019 Share Posted December 5, 2019 have you tried using something like postman to validate your query? difficult to analyse without seeing actual data vs collections of variables that could contain anything. Quote Link to comment Share on other sites More sharing options...
Hodo33 Posted December 6, 2019 Author Share Posted December 6, 2019 <?php $code = $_POST["code"]; // $tcpCode ACTION CALLED BY USERecho("CODE RECEIVED ".$code);switch($code){ case 1: updateFile(); break;}function updateFile(){ $ip = $_SERVER['REMOTE_ADDR']; // THIS IP SENT MESSAGE $name = $_POST["sname"]; $mis = $_POST["wmis"]; $date = date("Y-m-d"); $tab = "\t"; $nl = "\n"; $ipfile = "marsonetrack.txt"; $file = fopen($ipfile, "a"); fwrite($file,$date.$tab.$ip.$tab.$name.$tab.$mis.$nl); fclose($file); echo("ok");}?> Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.