<?php
if ($_GET["action"]=="ok") {
$id=$_GET["id"];
$con = mysql_connect("localhost","root","");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("test", $con);
mysql_query("set names'utf8'");
$result = mysql_query("SELECT * FROM xq where id=$id");
while($rs = mysql_fetch_array($result))
{
}
else
{
?>
<form id="form1" name="form1" method="post" action="?action=ok">
<p>
<?php
echo "<input name='n' type='text' id='n' value='$rs[Uname]' />";
?>
</p>
<p>
<input name="p" type="text" id="p" value="<?=$rs['Upassword']?>" />
</p>
<p>
<input type="submit" name="button" id="button" value="提交" />
</p>
</form>
<?php }
}
?>
if ($_GET["action"]=="ok") {
$id=$_GET["id"];
$con = mysql_connect("localhost","root","");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("test", $con);
mysql_query("set names'utf8'");
$result = mysql_query("SELECT * FROM xq where id=$id");
while($rs = mysql_fetch_array($result))
{
}
else
{
?>
<form id="form1" name="form1" method="post" action="?action=ok">
<p>
<?php
echo "<input name='n' type='text' id='n' value='$rs[Uname]' />";
?>
</p>
<p>
<input name="p" type="text" id="p" value="<?=$rs['Upassword']?>" />
</p>
<p>
<input type="submit" name="button" id="button" value="提交" />
</p>
</form>
<?php }
}
?>
if ($_GET["action"]=="ok") {
$id=$_GET["id"];
$con = mysql_connect("localhost","root","");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("test", $con);
mysql_query("set names'utf8'");
$result = mysql_query("SELECT * FROM xq where id=$id");
while($rs = mysql_fetch_array($result))
{
}
else // 这行报错了
{
?>
<form id="form1" name="form1" method="post" action="?action=ok">
<p>
<?php
echo "<input name='n' type='text' id='n' value='$rs[Uname]' />";
?>
</p>
<p>
<input name="p" type="text" id="p" value="<?=$rs['Upassword']?>" />
</p>
<p>
<input type="submit" name="button" id="button" value="提交" />
</p>
</form>
<?php }
}
?>
renrain1