Blank page?
Posted: Fri May 14, 2010 2:23 pm
When viewing this program in a browser, I'm getting nothing - no html, no php, no source whatsoever - just white. The page is coming up blank. Any idea why?
Code: Select all
<html>
<head>
<title> Student Delete </title>
</head>
<body>
<h1>Student Delete Form </h1>
<h2>Select a Student</h2>
<?php
$db = mysqli_connect("dbserver.com", "user", "password");
if (!db) {echo "Error: Could not connect to database.";
exit;}
mysqli_select_db("dbname");
$query = "SELECT id from student";
$result = mysqli_query($query);
$num_results = mysqli_num_rows($result);
echo "<p> Number of students found: ".$num_results."</p>";
echo "<form method='post' action='studentfind.php'>";
echo "ID:" <select name = 'id'>";
for ($i=0; $i < $num_results; $i++)
{
$row=mysqli_fetch_array($result);
$id = $row["id"];
echo "<option value = "$id"> $id </option>";
}
echo "<input type='submit' value='delete' />";
echo "</form>";
mysqli_close("$db");
?>
</body>
</html>