HTTP404未找到
点击确定按钮时出现找不到网页;代码如下
CODE{
<?php
if(isset($_POST['Submit'])){
require_once('connect.inc');
require_once('function.php');
$db = new mysql();
$db->connect($mydbhost, $mydbuser, $mydbpw, $mydbname,$mydbcharset);
if($_POST['password2'] !=$_POST['password'] ){
?>
<script language="javascript">
<!--
alert("您两次输入的密码不匹配!");
//-->
</script>
<?php
}
$sql = "insert into member values(null,'".html($_POST['name'])."','".html($_POST['password'])."')";
$query=$db->query($sql);
if($query)
{
header("location:main.php");
}
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=hz-gb-2312" />
<title>注册</title>
<link href="style.css" rel="stylesheet" type="text/css" />
</head>
<body>
<script language="javascript">
function check(){
if(document.form1.name.value == ''){
alert('姓名不能为空.');document.form1.name.select();
return false;
}
if(document.form1.password.value == ''){
alert('密码不能为空.');document.form1.name.select();
return false;
}
return true;
}
</script>
<form id="form1" name="form1" method="post" action="" onSubmit="return check()">
<table width="250" border="1" class="tableboder" align="center" cellpadding="1" cellspacing="1">
<tr>
<td height="20" class="header" colspan="2">网络名片注册</td>
</tr>
<tr>
<td height="20">姓名:</td>
<td height="20"><input name="name" type="text" size="15" maxlength="20" /></td>
</tr>
<tr>
<td height="20">密码:</td>
<td height="20"><input name="password" type="password" size="15" maxlength="20" /></td>
</tr>
<tr>
<td height="20">确认密码:</td>
<td height="20"><input name="password2" type="password" size="15" maxlength="20" /></td>
</tr>
<tr>
<td height="20" colspan="2"><div align="center">
<input type="reset" name="Submit2" value="重置" />
<input type="submit" name="Submit" value="提交" />
</div></td>
</tr>
</table>
</form>
</body>
</html>
}