このコードを使用した登録が表示されないのはなぜですか?
<br /><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><br /><html xmlns="http://www.w3.org/1999/xhtml"><br /><head><br /><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><br /><title>无标题文档</title><br /></head><br /><br /><body><br /><?php<br />$conn=mysql_connect('localhost','root','')or die('数据库连接错误');<br />mysql_select_db('demo',$conn);<br />mysql_query("set names 'gbk'");<br />//检测会员名称是否存在<br />if($_post[username]){<br /> $sql="select * from users where username='$_post[username]'";<br /> $res=mysql_query($sql)or die("查询失败!");<br /> $us=$_get[name];<br /> echo $us."222222";<br /> $ps教程= md5($_post[password]);<br /> $sex=$_post['sex'];<br /> $age=$_post['age'];<br /> $qq=$_post['qq'];<br /> $phone=$_post['phone'];<br /> $email=$_post['email'];<br /> $address=$_post['address'];<br /> if(is_array(mysql_fetch_row($res))){<br /> echo "该会员名已经存在!";<br /> }else{<br /> $sql="insert into users (username,password,sex,age,qq,phone,email,address) values ('$us','$ps',$sex,$age,$qq,'$phone','$email','$address')";<br /> echo $sql;<br /> mysql_query($sql)or die("注册失败");<br /> echo "<script>alert('注册成功');location.href='login.php'</script>";<br /> }<br />}<br />?><br /><script language="javascript" type="text/javascript"><br />function docheck(){<br />var username = document.regform.username.value;<br />var pwd =document.regform.password.value;<br />var repwd=document.regform.repassword.value;<br />if(username==""){<br /> alert("请输入用户名!");<br /> return false;<br />}<br />if(pwd==""){<br /> alert("请输入密码!");<br /> return false;<br />}<br />if(repwd != pwd){<br /> alert("两次填写的密码不相同!");<br /> return false;<br />}<br />}<br /></script><br /><script language="javascript"><br />function createxmlhttprequest(){<br /> var xmlhttp;<br /> if(window.activexobject){<br /> xmlhttp = new activexobject("microsoft.xmlhttp");<br /> }else{<br /> xmlhttp = new xmlhttprequest();<br /> }<br /> //return xmlhttp;<br />}<br />function checkname(){<br /> var name = document.getelementbyid('username'); //获取用户名文本框<br /> var span = document.getelementbyid('name_info'); //获取用于显示结果的span标记<br /> if(name.value.length <= 4){<br /> span.style.color = '#ff0000'; //设置span标记内的字体颜色为红色<br /> span.innerhtml = '用户名长度不能少于4个字符!'; //span标记内容<br /> return false;<br /> }<br /> var xmlhttp = createxmlhttprequest();//创建异步请求对象<br /> var time = new date().gettime();<br /> var url = 'regval.php?name=' + name.value + '&tmp=' + time;//构造出请求地址<br /> xmlhttp.open("get",url,true); //建立一个异步请求<br /> //这里我们使用get方式请求<br /> xmlhttp.onreadystatechange = function(){ //监视请求状态<br /> span.style.color = '#ff9900';<br /> span.innerhtml = '查询中,请稍候!';<br /> if(xmlhttp.readystate == 4 && xmlhttp.status == 200){<br />alert(xmlhttp.responsetext+"........");<br /> if(xmlhttp.responsetext.indexof('no') != -1){ //如果服务器返回的信息中有no<br /> span.style.color = '#cb2121'; //设置span标记颜色为红色<br /> span.innerhtml = '用户名[' + name.value + ']已经被别的用户使用!';<br /> //document.regform.username.value="";<br /> }else{//如果返回信息中没有no<br /> span.style.color = '#00a800';//设置颜色为绿色<br /> span.innerhtml = '恭喜您,该用户名未被注册!';<br /> }<br /> return true;<br /> delete xmlhttp; //删除请求对象<br /> }<br /> }<br /> xmlhttp.send(null); //发送请求<br />}<br /></script><br /> <form action="regval.php" method="post" onsubmit="return docheck()" name="regform"><br /> 会员名称:<br /> <input type="text" name="username" value="" id="username" onblur="checkname()"/><br /><span id="name_info"></span><br /> <br><br /> 密 码:<br /> <input type="password" name="password" value=""/><br><br /> 确认密码:<br /> <input type="password" name="repassword" value=""/><br><br />性别:<br />男:<input name="sex" type="radio" value="0" checked="checked"/><br />女:<input name="sex" type="radio" value="1"/><br><br />年龄:<input type="text" name="age" value=""/><br><br />qq:<input type="text" name="qq" value=""/><br><br />电话:<input type="text" name="phone" value=""/><br><br />email:<input type="text" name="email" value=""/><br><br />地址:<input type="text" name="address" value=""/><br><br /> <input type="submit" name="sub" value="注册"/><br /> <input type="reset" name="re" value="取消"/><br /> </form><br /><br /></body><br /></html><br /><br />