亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

注意:未定義變量:第 16 行 /Applications/XAMPP/xamppfiles

注意:未定義變量:第 16 行 /Applications/XAMPP/xamppfiles

PHP
森林海 2021-08-28 10:27:14
使用用戶名登錄應用程序時,不使用電子郵件,因此會拋出以下錯誤,反之亦然“注意:未定義索引:電子郵件在 /Applications/XAMPP/xamppfiles/htdocs/menthor/login.php 中的第 16 行”我試過將產生錯誤的行放在條件中,但這些努力證明是徒勞的 Login.php 文件(與錯誤相關的部分)// STEP 1. Receive data / info paassed to current fileif ((empty($_REQUEST['username']) || empty($_REQUEST['password'])) && (empty($_REQUEST['email']) || empty($_REQUEST['password']))) {    $return['status'] = '400';    $return['message'] = 'Missing requird information';    echo json_encode($return);    return;} // securing received info / data from hackers or injections$email = htmlentities($_REQUEST['email']);$username = htmlentities($_REQUEST['username']);$password = htmlentities($_REQUEST['password']);// STEP 2. Establish connection with the serverrequire('secure/access.php');$access = new access('localhost' , 'root', '' , 'menthor');$access->connect();// STEP 3. Check existence of the user. Try to fetch the user with the same email address// STEP 3. Check availability of the login/user information$username_aval = $access->selectUser_Username($username);$email_aval = $access->selectUser_Email($email);//$return = array();// user is foundif ($username_aval) {    // Get encrypted password and salt from the server for validation    $encryptedPassword = $username_aval['password'];    $salt = $username_aval['salt'];通過 Web 服務器登錄時的當前結果Notice: Undefined index: email in /Applications/XAMPP/xamppfiles/htdocs/menthor/login.php on line 16{"status":"200","message":"Successfully Logged In","id":"44","username":"rondell","email":"[email protected]","fullName":"rondell","lastName":"","birthday":"","gender":"","cover":"","ava":"","bio":"","allow_follow":"1"}預期成績{"status":"200","message":"Successfully Logged In","id":"44","username":"rondell","email":"[email protected]","fullName":"rondell","lastName":"","birthday":"","gender":"","cover":"","ava":"","bio":"","allow_follow":"1"}
查看完整描述

2 回答

?
吃雞游戲

TA貢獻1829條經驗 獲得超7個贊

事實證明,經過一番思考,解決方案非常簡單......我只需要簡單地創建兩個 login.php 文件......一個專門用于使用用戶名和密碼登錄的用戶,另一個用于用戶簽名輸入電子郵件和密碼...干杯


查看完整回答
反對 回復 2021-08-28
?
江戶川亂折騰

TA貢獻1851條經驗 獲得超5個贊

使用電子郵件作為對象,或者您可以轉儲請求并查看發生了什么


查看完整回答
反對 回復 2021-08-28
  • 2 回答
  • 0 關注
  • 151 瀏覽

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號