点击列表的链接,总是出来原来的页面(http://127.0.0.1/),地址上的参数变了(http://127.0.0.1/?id=3),但是页面内容不变,怎么回事?
<style type="text/css">
<!--
body {
font-size: 9pt;
}
-->
</style>
<?php
$db = mysql_connect("192.168.0.2", "root"
;
mysql_select_db("mysql",$db);
if ($id)
{ $result = mysql_query("SELECT * FROM employees WHERE id=$id",$db);
$myrow = mysql_fetch_array($result);
printf(" 名: %s\n", $myrow["first"]);echo"<br>";
printf(" 姓: %s\n", $myrow["last"]);echo"<br>";
printf("住址: %s\n", $myrow["address"]); echo"<br>";
printf("职位: %s\n", $myrow["position"]);
}
else
{
// show employee list
// 显示员工列表
$result = mysql_query("SELECT * FROM employees",$db);
if ($myrow = mysql_fetch_array($result)) {
// display list if there are records to display
// 如果有记录,则显示列表
do {
printf("<a href=\"%s?id=%s\">+%s %s</a>\n", $PATH_INFO, $myrow["id"], $myrow["first"], $myrow["last"]);
echo"<br>";
} while ($myrow = mysql_fetch_array($result));
}
}
?>