having a panic here! my dissertation website works fine online, but an hour before submission i found out it doesnt work on a local host..two or 3 pages keep coming up with undefined index or variable. could anyone help? Here is a snipped of an error: Notice: Undefined index: tables in C:\Users..\Desktop\USBWebserver v8_enoot\SnysbArchive\Search.php on line 76
<?php
include 'UserFunction.php';
..html omitted..
//write connect function in here
include('Connect.php'); //Connects to database
$sql = "SHOW TABLES FROM $dbname";
$result = mysql_query($sql);
if (!$result)
{
echo "DB Error, could not list tables
";
echo 'MySQL Error: ' . mysql_error();
exit;
}
if (mysql_select_db($dbname, $conn))
{
?>
<form method="post" action="SearchResults.php?go" id="searchform">
In <select name="tables">
<?php
while ($row = mysql_fetch_row($result))
{
if ($row[0] != 'user_details' && $row[0] != 'request')
{
echo '<option value="'.$row[0].'">'.$row[0].'</option>';
}
}
}
?>
</select>
Seach for: <input type="text" name="name">
<input type="submit" name="submit" value="Search" />
</form>
<br>
<?php
$tbl=$_POST['tables'];
echo $tbl;
?>
it doesnt like this line $tbl=$_POST['tables']; thanks