I am currently going through some problems could anyone see if they could fix it?
I am working through the Project Battle tutorial aka Javascript/Ajax Building a MMORPG
I am having problems with the connect.php could someone look at it and see if they can see whats wrong?
connect.php
Code: Select all
<?php
$db = mysql_connect("localhost", "root", "pass") or die("Could not connect.");
if(!$db)
die("no db");
if(!mysql_select_db("battle",$db))
die("No database selected.");
if(!get_magic_quotes_gpc())
{
$_GET = array_map('mysql_real_escape_string', $_GET);
$_POST = array_map('mysql_real_escape_string', $_POST);
$_COOKIE = array_map('mysql_real_escape_string', $_COOKIE);
}
else
{
$_GET = array_map('stripslashes', $_GET);
$_POST = array_map('stripslashes', $_POST);
$_COOKIE = array_map('stripslashes', $_COOKIE);
$_GET = array_map('mysql_real_escape_string', $_GET);
$_POST = array_map('mysql_real_escape_string', $_POST);
$_COOKIE = array_map('mysql_real_escape_string', $_COOKIE);
}
?>