PHP Help?

Miscellaneous Forums/General Discussion/PHP Help?

I don't know PHP and don't really care to learn considering the is the first and only time I need it.

I need a script like GNet (I know its been discused before) to host information on: Game Name, Server Name, IP, Players in, Ping.

Does anybody have a script like this?

Yes but you'll need to know PHP to implement it properly :)

Just as a side note, PHP is easy. If you can write games in Blitz, you can get into PHP easily. I wrote a simple, but functional, asset management system with PHP, MySQL and SVN in four long days at work, never having touched either PHP or MySQL when I started. I added lots of features to it later, such as a thumbnail generation (ImageMagik), better search features, QuickTime streaming and more, but the basic structure (messy as it was), was up and fully usable in four days.

Heck...even wrote the damn thing in emacs over telnet to a Linux server, never having used emacs before either. :)

Ragnar

if i remember right, the complete gnet-source (incl php and sql) was included in the blitz3d download...dunno for sure, cant look by myself, 'cause im at work but if i were you i would take a look into it!

/edit: GOSH! found it in the toolbox archives: http://blitzbasic.com/toolbox/toolbox.php?tool=61

cheers

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

Use this for easy file requests!