这里有恐慌!我的论文网站在网上运行良好,但在提交前一小时我发现它在本地主机上不起作用.. 两三个页面不断出现未定义的索引或变量。有人可以帮忙吗?这是一个错误的片段:注意:未定义的索引:第 76 行 C:\Users..\Desktop\USBWebserver v8_en\root\SnysbArchive\Search.php 中的表
<?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\n";
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;
?>
它不喜欢这一行 $tbl=$_POST['tables']; 谢谢