use HTTP to send variables to php.
#1

hi people.

how i can use in HTTP to return a variables from the server to php?..
this is currect: ?

pawn Код:
HTTP(playerid,HTTP_POST,"http://xx.xx.xx/index.php",?,onRequestDone());
thank's in advance..
Reply
#2

The callback must be in quotes and should not contain the round brackets. An example of that would be:
pawn Код:
HTTP(playerid, HTTP_POST, "http://xxx.com/index.php", ?, "onRequestDone");
Also, if I understand you correctly, you've no idea what to feed instead of the ?. I think this should give you an idea:
pawn Код:
HTTP(playerid, HTTP_POST, "http://xxx.com/index.php", "var1=data&var2=data", "onRequestDone");
edit
Ooh, and also, don't forget about the Sockets plugin by BlueG, which allows you to transport data between your gameserver and PHP even better.
Reply
#3

Yes, just use the data parameter to send variables in this format:
Код:
name=evil&foo=bar&session=123
PHP код:
$name $_REQUEST['name']; 
Reply
#4

ok, all right.
but if have some poepole wathing with the page?
Reply
#5

Make it protected with a password or something, which gets passed with the POST data, or make it only allow connections from your server's IP.

PHP код:
if($_POST['passkey'] != 'passkey_goes_here') die(); 
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)