<?php
$connector = @mysql_connect("localhost","root","usbw"); // open sql connection
mysql_select_db("dnhsdb",$connector);
$i = @$_POST['uId'];
$d = @$_POST['pass'];
if (isset($_POST["btnLog"]))
{
$resultID = mysql_query("SELECT * FROM ACCOUNT", $connector);
$row = mysql_fetch_row($resultID);
if($i == $row['username'] && $d == $row['pass'])
{
echo "Welcome Userid " . $row['username'] . "!";
header('Location: form18dnhs.php');
}
else
echo "Wrong Id/Password";
}
错误信息说:
Undefined index: username in C:\Users\Chad\Desktop\MAIN_php_project\USBWebserver v8_en\root\DNHS\login.php on line 21
Wrong Id/Password