我试图创建简单的用户登记表。 页: 1 当我点击提交书子时,它就进入了<编码>register.php网页,但情况并非如此。 没有任何错误或任何东西。 我在<编码>上有一些<代码>echo的声明,载于register.php
,但同时也不做任何工作。
这是<代码>index.html:
<form action="register.php" method="post">
<table width="384" border="1" align="center">
<? echo <tr><td colspan="2"> .$final_report. </td></tr> ;?>
<tr>
<td width="50%">Username:</td>
<td width="50%"><label>
<input name="username" type="text" id="username" size="30" />
</label></td>
</tr>
<tr>
<td>Password:</td>
<td><input name="password" type="password" id="password" value="" size="30" /></td>
</tr>
<tr>
<td>Email:</td>
<td><input name="email" type="text" id="email" size="30" /></td>
</tr>
<tr>
<td> </td>
<td><label>
<input name="register" type="submit" id="register" value="Register" />
</label></td>
</tr>
</table>
</form>
这是<代码>register.php:
<?
include_once"config.php";
if(isset($_POST[ register ])){
$username = $_POST[ username ];
$password = $_POST[ password ];
$email = $_POST[ email ];
$memip = $_SERVER[ REMOTE_ADDR ];
$date = date("d-m-Y");
if($username == NULL OR $password == NULL OR $email == NULL){
$final_report.= "Please complete the form below..";
}else{
if(strlen($username) <= 3 || strlen($username) >= 30){
$final_report.="Your username must be between 3 and 30 characters..";
}else{
$check_members = mysql_query("SELECT * FROM `members` WHERE `username` = $username ");
if(mysql_num_rows($check_members) != 0){
$final_report.="The username is already in use!";
}else{
if(strlen($password) <= 6 || strlen($password) >= 12){
$final_report.="Your password must be between 6 and 12 digits and characters..";
}else{
if(!eregi("^[_a-z0-9-]+(.[_a-z0-9-]+)*@[a-z0-9-]+(.[a-z0-9-]+)*(.[a-z]{2,3})$", $email)){
$final_report.="Your email address was not valid..";
}else{
$create_member = mysql_query("INSERT INTO `members` (`id`,`username`, `password`,`email`, `ip`, `date`)
VALUES( , $username , $password , $email , $memip , $date )");
$final_report.="Thank you for registering, you may login.";
}}}}}}
?>
谁能看到错误?