我今天已经调整并打破了这一百万次!我基本上是在尝试检查数据库中的用户名和激活,如果用户被激活,则显示祝贺消息,如果用户是用户但没有激活显示激活消息,如果他们不是记录匹配用户,则显示无效消息。 任何有关重新编码和纠正我的错误的帮助将不胜感激,我觉得我只是在兜圈子!
string(74) "更新成员 SET Check_Activation='' WHERE Username='' AND Activation=''"
<form name="form1" method="post" action="check-activation.php">
<div align="center">
<table width="35%" border="0">
<tr>
<td>Members Number</td>
<td>:</td>
<td><label>
<input name="username" type="text" id="username" value="<?php echo $username; ?>">
</label></td>
</tr>
<tr>
<td>Activation Code</td>
<td><label>:</label></td>
<td><input name="activation_code" type="text" id="activation_code" value="<?php echo $activation_code; ?>"></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td><label>
<input type="submit" name="Submit" value="Submit">
<input type="reset" name="Submit2" value="Cancel">
</label></td>
</tr>
</table>
</div>
</form>
这是表格
<?php
$db_host = "*******";
$db_name = "*******";
$db_use = "*******";
$db_pass = "*******";
$link = mysql_connect($db_host, $db_use, $db_pass);
mysql_select_db($db_name, $link);
$command = "UPDATE members SET Check_Activation='$activation_code' WHERE Username='$username' AND Activation='$activation_code'";
$result = mysql_query($command);
if ($result) {
echo "Congratulations. Your membership has been activated ...";
}else{
echo ("You've entered an invalid username / activation code - please retry");
}
?>
这是检查数据库并显示结果