当前位置:Gxlcms > PHP教程 > 一个关于注册的php页面

一个关于注册的php页面

时间:2021-07-01 10:21:17 帮助过:3人阅读

学生注册请把信息添写完整

"; echo ""; exit; } $query="select * from $student_infor where no='$xuehao' and name='$name'"; mysql_query("set names 'GB2312'"); $result=mysql_query($query); $row=mysql_fetch_array($result); if($row==0) { echo"

你输入的信息有误,不属于计算机学院毕业生!

"; echo ""; exit; } $query="select * from $student_table where xuehao='$xuehao'"; mysql_query("set names 'GB2312'"); $result=mysql_query($query); $row=mysql_fetch_array($result); if($row!=0) { echo"

此学号已注册,请重新填写!

"; echo ""; exit; } if($password!=$password1) { echo"

输入的密码不一致,请重新输入!

"; echo ""; exit; } $query="insert into $student_table values('$xuehao','$name','$sex','$class','$password','$love','$telephone','$reward','')"; mysql_query("set names 'GB2312'"); $result=mysql_query($query); if($result==true){ echo "

注册成功!

"; echo ""; exit; }?>


回复讨论(解决方案)


这是显示结果,显示2秒后就又跳转回注册页面了,哪里出错了?

$xuehao...这几个变量是哪里来的?

$xuehao...这几个变量是哪里来的? 这是我的另一个php页面

学生注册页面 

那也是$_POST['xuehao'] 呀

那也是$_POST['xuehao'] 呀 什么意思?

错误提示:$xuehao未定义!!!

register.php
extract($_POST); //加上这句
if ($xuehao=="" ||$name=="" || $class=="" ||$password=="" ||$password1=="" ||$telephone=="")

是不是可以这样理解呢?
$heihao 定义的变量。。
$_GET['xuehao'] 才是从另一个页面传递过来的呢。。

我也是菜鸟,刚接触

register.php
extract($_POST); //加上这句
if ($xuehao=="" ||$name=="" || $class=="" ||$password=="" ||$password1=="" ||$telephone=="") 感谢,问题解决了!

人气教程排行