我正在試圖在網站上僅顯示會員部分。用戶必須輸入他的用戶名和密碼才能登錄。我爲用戶設置了註冊部分,他們可以在我的網站上創建一個帳戶。會員只有一個網站的部分
同樣如下面的代碼所示,我可以導航到用戶網站的唯一部分。但問題是我需要將值$ myusername傳遞給頁面members_area.php,以便我可以在該頁面上執行一些數據庫查詢。我怎麼做 ?
$sql="SELECT * FROM table_name WHERE email= '$myusername' and password='$mypassword'" ;
$result=mysql_query($sql,$ms);
$user_exist = mysql_num_rows($result);
// if the user is there in the database
if($user_exist>0){
//start a session over here
$_SESSION["valid_user"] = $myusername;
Header('Location: members_area.php');
}
你的問題是如何讀取上一頁發佈的HTML輸入表單的值? – Thilo
如果是這樣,也許這有助於:http://stackoverflow.com/questions/5449775/how-to-read-a-webform-with-php – Thilo