PHP Help?

Miscellaneous Forums/General Discussion/PHP Help?

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

POST request header:
POST /updateserverinfo.php HTTP/1.1
Host: www.host.com
User-Agent: YourApplicationName
Connection: Close

gamename=YourApplicationName&servername=YourServerName&ip=YourIP&players=23&ping=128


POST php code:
<?php
	$game_name = $_POST['gamename'];
	$server_name = $_POST['servername'];
	$server_ip = $_POST['ip'];
	$players = $_POST['players'];
	$ping = $_POST['ping'];
?>



GET request header:
GET /updateserverinfo.php?gamename=YourApplicationName&servername=YourServerName&ip=YourIP&players=23&ping=128 HTTP/1.1
Host: www.host.com
User-Agent: YourApplicationName
Connection: Close



GET php code:
<?php
	$game_name = $_GET['gamename'];
	$server_name = $_GET['servername'];
	$server_ip = $_GET['ip'];
	$players = $_GET['players'];
	$ping = $_GET['ping'];
?>


I'll leave the saving routine for you to create.

Use WebCompatible() for the values of the variables, otherwise incompatible characters may crash the request: http://www.blitzbasic.com/codearcs/codearcs.php?code=1357