I have a PHP file that lists all the current databases and allows the user to add in databases via a form.
I get a completey blank page when I view the following PHP file (username and password have been purposely concealed, and I am sure the connection works with the real PW and username). The problem has to do with the top PHP, because when I remove it, the page is not blank anymore (although it won’t list out the databases of course).
<?php
$conn = @mysql_connect("localhost", "username", "password") or die("could not connect");
$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>
<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>