日期:2014-05-17  浏览次数:20702 次

为什么PHP脚本不运行,求高手,在线等!
[code=PHP][/code]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtm11/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>SearchBug</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<script type="text/javascript">
<?php
$searchbugid=$_POST('sbugid');
if (!$searchbugid)
{
echo 'You have not entered any search details. Please go back and try again.';
exit;
}
if (!get_magic_quotes_gpc())
{
$searchbugid = addslashes($searchbugid);
}

@ $db = new mysqli('localhost','abc','123','bugs');

if (mysqli_connect_errno())
{
echo 'Error: Could not connect to database. Please try again later.';
exit;
}

$query = "select * from bug where bugin like '%"$searchbugid"%'";
$result = $db->query($query);
$rs = mysqli_fetch_assoc($result);

echo "<p>The bug ID".$searchbugid." has been found.</p>";
?>
window.onload = function
{
document.getElementsById("bugid").value=$rs['bugin'];
document.getElementsById("rname").value=$rs['rname'];
document.getElementsById("rdate").value=$rs['rdate'];
document.getElementsById("sdescription").value=$rs['sdescription'];
document.getElementsById("ldescription").value=$rs['ldescription'];
document.getElementsById("actionstaken").value=$rs['actionstaken'];
}

</script>
<style type="text/css">
span.highlight
{
background-color:#cccccc
}
body
{
TEXT-ALIGN: center;

}
form.geshi
{
MARGIN-RIGHT: auto;
MARGIN-LEFT: auto;
}
#alsocenter
{
MARGIN-RIGHT: auto;
MARGIN-LEFT: auto;
}
</style>
</head>
<body>
<h1 align="center">Update Bug Report</h1>

<form class="geshi" action="" method="post">
<table id="alsocenter" border="0">
<tr bgcolor="#cccccc">
<td>Bug ID</td>
<td align="center"><input type="text" ID="bugid" /></td>
<br/>
<tr>
<td>Record by:</td> 
<td align="center"><input type="text" ID="rname" /></td>
</tr>
<tr bgcolor="#cccccc">
<td>Date:</td>
<td align="center"><input type="text" ID="rdate" /></td>
<br/>
<tr>
<td>Short Description:</td>
<td align="center"><input type="text" ID="sdescription" /></td>
</tr>
</table>
<span class="highlight">Long Description of Bug</span>
<br/>
<textarea rows="3" cols="40" id="AAA" ID="ldescription" >
</textarea>
<br/>
<span class="highlight">Actions Taken</span>
<br/>
<textarea rows="3" cols="40" id="BBB" ID="actionstaken" >
</textarea>
<br/>
<br/>
<input type="reset" value="Reset" style="width:100px;height:20px">
<input type="submit" value="Update" style="width:100px;height:20px" onclick="return(confirm(