[摘要]strlen(name)>15) echo"<br><center><font color=blue>用户名的长度不符合要求。请</...
strlen($name)>15){
echo"<br><center><font color=blue>用户名的长度不符合要求。请</font><a href=zcyh.php>返回</a></center><br>";
include("foot.inc.php");
exit();
}
if (!eregi("^[_a-z0-9-]+(\.[_a-z0-9-]+)*$", $name)) {
echo"<br><center><font color=blue>注册名只能由字母数字组成.请</font><a href=zcyh.php>返回</a></center><br>";
include("foot.inc.php");
exit();
}
if ($name)
{
$conn=@mysql_connect("localhost");
$sql=@mysql_select_db("jocky",$conn);
$result=@mysql_query("select * from user1 where name='$name'" ,$conn);
if($result){
if(@mysql_fetch_object($result)){
echo"<br><center><font color=blue>对不起,已经有相同的用户名!请</font><a href=zcyh.php>返回</a>.</center><br>";}
else{$conn=@mysql_connect("localhost");
$sql=@mysql_select_db("jocky",$conn);
$sqldo="insert into user1 (name) values ('$name')";
@mysql_query($sqldo,$conn);
echo"<br><center><font color=blue>你好,</font>";
echo"<font color=red><b>$name</b></font></center>";
include("zhuce.php");
@mysql_close($conn);}
include("foot.inc.php");
exit();
}
}
?>
</div>
<?include("foot.inc.php")?>
</body>
</html>
第三个是:check.php(判断注册资料是否正确,然后插入数据库,重新登录)
<?include("header1.inc.php")?>
<div align=center>
<table width="89%" border="0">
<tr>
<td><font color="#ff0000">当前位置:<a href="index.php">主页</a>>><a href=zcyh.php>注册页面</a>>>详细资料</font></td>
</tr>
</table><br>
<?
if($truename==""){
echo"<br><center><font color=blue>真实姓名不能为空。请</font><a href=
javascript:history.go(-1);>返回</a></center><br>";
include("foot.inc.php");
exit();
}
if($password==""
关键词:用户的详细注册与判断