我正在使用isset
函数来检查是否单击了提交按钮,但它不起作用。它没有进入if
. 这是我的代码。我没有得到问题仍然存在的地方。
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><h2><br />
User Registration</h2>
<p> </p></td>
</tr>
<tr>
<td>
<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post" name="form1" id="form1" onsubmit="return Validate();">
User Name[E-mail ID]: <input type="text" name="username" style="width:230px; height:20px;" /><br /><br />
Password : <input type="password" name="password" style="width:230px; height:20px;" /><br /><br />
Name <input type="text" name="name" style="width:230px; height:20px;" /><br /><br />
Contact Number: <input type="text" name="phone" style="width:230px; height:20px;" /><br /><br />
Email: <input type="text" name="email" style="width:230px; height:20px;" /><br /><br />
<input type="submit" value="REGISTER" />
</form>
<?php
include('connect.php');
if (isset($_POST['submit']))
{
echo "1";
$username = $_POST['username'];
echo $username;
$password = $_POST['password'];
$name = $_POST['name'];
$phone = $_POST['phone'];
$email = $_POST['email'];
//$id = $_GET['aid'];
$sql = "INSERT INTO user_info(application_id, username, password, name, contact, email) VALUES (" . $aid. ", " .$username.", ".$password.", ".$name.",". $phone.", ".$email.") ";
echo $sql;
mysql_query($sql) or die(mysql_error());
//header("Location: index1.php");
}
?>
</td>
</tr>
<tr>
<td> </td>
</tr>
</table>
请让我知道我哪里出错了。