使用用戶名登錄應(yīng)用程序時(shí),不使用電子郵件,因此會(huì)拋出以下錯(cuò)誤,反之亦然“注意:未定義索引:電子郵件在 /Applications/XAMPP/xamppfiles/htdocs/menthor/login.php 中的第 16 行”我試過(guò)將產(chǎn)生錯(cuò)誤的行放在條件中,但這些努力證明是徒勞的 Login.php 文件(與錯(cuò)誤相關(guān)的部分)// 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'];通過(guò) Web 服務(wù)器登錄時(shí)的當(dāng)前結(jié)果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":"rondell@gmail.com","fullName":"rondell","lastName":"","birthday":"","gender":"","cover":"","ava":"","bio":"","allow_follow":"1"}預(yù)期成績(jī){"status":"200","message":"Successfully Logged In","id":"44","username":"rondell","email":"rondell@gmail.com","fullName":"rondell","lastName":"","birthday":"","gender":"","cover":"","ava":"","bio":"","allow_follow":"1"}
2 回答

吃雞游戲
TA貢獻(xiàn)1829條經(jīng)驗(yàn) 獲得超7個(gè)贊
事實(shí)證明,經(jīng)過(guò)一番思考,解決方案非常簡(jiǎn)單......我只需要簡(jiǎn)單地創(chuàng)建兩個(gè) login.php 文件......一個(gè)專門(mén)用于使用用戶名和密碼登錄的用戶,另一個(gè)用于用戶簽名輸入電子郵件和密碼...干杯

江戶川亂折騰
TA貢獻(xiàn)1851條經(jīng)驗(yàn) 獲得超5個(gè)贊
使用電子郵件作為對(duì)象,或者您可以轉(zhuǎn)儲(chǔ)請(qǐng)求并查看發(fā)生了什么
- 2 回答
- 0 關(guān)注
- 173 瀏覽
添加回答
舉報(bào)
0/150
提交
取消