此代碼無法識別我的數據庫中登錄的用戶。我已經嘗試了幾件事,至今都沒有影響到任何東西。有人能指出錯誤(S)CSS登錄用戶無法識別
<?php
session_start();
include("dbconnect.php");
$numrows=0;
$sqlMember = mysql_real_escape_string($_POST["Membership_Number"]);
$sqlPassword = mysql_real_escape_string($_POST["Password"]);
$query="SELECT First_name, Last_name, Membership_Number FROM members WHERE Membership_Number='$member' AND Password='$password'";
$link = mysql_query($query);
if (!$link) {
die('login error');
}
$numrows=mysql_num_rows($link);
if ($numrows>0){ // authentication is successfull
while($row = mysql_fetch_array($query));
$_SESSION['user']['first_name']=$row['first_name'];
$_SESSION['user']['last_name']=$row['last_name'];
$_SESSION['user']['Membership_Number ']=$row['Membership_Number '];
echo $_SESSION['user']['fname'].' '.$_SESSION['user']['lname'];
header("location:members_area.php");
} else {
header("location:../invalid.php"); // authentication was unsuccessfull
}
?>
HTML
<form id="jjjj" action="Send_log_details.php" class="register" method="POST">
<ul>
<li>
Membership Number:<br>
<input type="text" id="Membership_Number" name="Membership_Number">
</li>
<li>
Password:<br>
<input type="password" id="Password" name="Password" value="Log in">
</li>
<li>
<input type="submit" name="register" value="Login" onclick="logMeIn()">
</li>
</ul>
</form>
感謝您的幫助
CSS與會話無關。請指出一個更明智的問題。 – Halcyon
**不要以明文**存儲密碼。 – SLaks
你需要高級CSS查詢這個 –