Hi,
I have been stuck now for 2 hours and I have retyped this from the tutorial book twice in case of typos.
Can anyone tell me why I keep getting an http 500 error? The code is exactly as written in the book but no show in the browser. (IE, FF or NN)
I am using Apache and PHP on a locally set up server on my laptop. Apache is working. MySQL is working. I am able to parse other php scripts but not this one.
Any suggestions would be appreciated.
I have included the whole html/php below.
Many thanks
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<?php
$conn = mysql_connect("localhost","root","enterprise")
or die("Sorry - could not connect to MySQL!")
$rs1 = @mysql_create_db($_REQUEST['db']);
$rs2 = @mysql_list_dbs($conn);
for($row = 0; $row < mysql_num_rows($rs2); $row++)
{ $list .= mysql_tablename($rs2, $row) . " | ";}
?>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Create Database</title>
</head>
<body>
<form action="<?php echo($_SERVER['PHP_SELF']); ?>"
method="post">Current databases: <?php echo($list); ?>
<hr />Name:<input type="text" name="db" />
<input type="submit" value="Create database" />
</form>
</body>
</html>