正在学习无需刷新表单验证 错误提示Undefined index: ID 不知道问题到底出在何处 真心求解释啊
正在学习无需刷新表单验证 错误提示Undefined index: ID 不知道问题到底出在何处 真心求解释啊<label>账号:</label>
<input name="ID" type="text" onblur="sendRequest(this.value);" size="40" />
<span id="chkr"></span><br />
<?php
$mysql_server_name = "localhost";
$mysql_username = "root";
$mysql_password = "123";
$mysql_database = "register";
mysql_connect( $mysql_server_name, $mysql_username, $mysql_password )
or die("database communication failed");
mysql_select_db($mysql_database);
$message = "";
$ID = $_GET['ID'];
$query = "SELECT username FROM users WHERE username = '$ID'";
$result = mysql_query($query);
if( mysql_num_rows($result) != 1 )
{
// The user ID specified was not found
$message = "False";
}
else
{
// The user ID found
$message = "True";
}
?>
<?php echo $message; ?>
按12后提示
Notice: Undefined index: ID in E:\php\htdocs\045-checkID.php on line 20
False
是说ID没有定义么 真心求解释