日期:2014-05-17  浏览次数:20705 次

好奇怪~~~POST读不到数据
原版的html代码是这样子滴,我也不知道是哪里出错了。。。反正就是在insert_user.php里用$_POST["user_name"]读不到数据。。。它会给我提示用户名为空。。。

<!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=utf-8" />
<link rel="stylesheet" type="text/css" href="../public/css/login.css">
<script type="text/javascript" src="opten.js"></script>
<title>注册</title>
 <script language="javascript">
  function show_confirm() 
  { 
  var r=confirm("确定提交您的注册信息么"); 
   if (r==true) { 
   alert("您已注册成功!"); 
   } 
   else 
   { 
   //alert("You pressed Cancel!"); 
   } 
 } 
 </script> 
</head>
<style type="text/css">
body,td,th {

0;
font-size: 20px;
color: #673310;
font-family: "楷体";
}
<!--
.STYLE1 {
color: #234d19;
font-size: 15px;
font-family: "楷体";
}
-->
</style>
<body>
<form action="../MywebPHP/insert_user.php" method="post" >
<div id="containt">
    <div id="table">
    <table width="400" height="70" border="0" >
    <tr><td>用户名:<input value="请勿填写中文" size="18" name="user_name">*</td></tr>
    <tr><td>请输入密码:<input value=" " size="20" name="user_password1">*</td></tr>
    <tr><td><span class=STYLE1>请输入8-12位由数字、字母组成的密码</span></td></tr>
    <tr><td>请再次输入密码:<input value=" " size="20" name="user_password2">*</td></tr>
    <tr><td>邮&nbsp;&nbsp;&nbsp;箱:<input value=" " size="20" name="email"></td></tr>
    <tr><td>性&nbsp;&nbsp;&nbsp;别:
     <select onchange="if (this.selectedIndex!=0)
     (this.value)">
     <option selected>选择性别</option>
     <option value="男">男</option>
     <option value="女">女</option>
      </select>
    </td></tr>
    <tr><td>电话号码:<input value=" " size="20" name="telephone"></td></tr>
    <tr><td><input name="confirm"  type="checkbox" onclick="agree();" id="cb"/>我认真阅读并接受协议。</td></tr>
    <tr><td align="center"><span class=STYLE1>*为必填项目</span></td></tr>
</table>
    </div>
<div id="back">
     <a href="../index.php"><img src="../public/img/r