我有一個問題$remarks
。它給我一個錯誤:
Notice: Undefined index: remarks in C:\xampp\htdocs\index.php on line 83
我不知道如何解決這個問題。當我完成註冊部分中的所有字段時,它看起來沒問題(「註冊成功」),但沒有數據添加到我的數據庫中。有人能幫我嗎?
<?php
$remarks=$_GET['remarks'];
$username="username";
$password="password";
if ($remarks==null and $remarks=="")
{
echo 'Register Here';
}
if ($remarks=='success')
{
$insert = mysql_query("INSERT INTO simple_login('username','password') VALUES ('$username','$password')");
echo 'Registration Success';
}
?>
刪除'('username','password')'中的引號或者更好,用反引號替換它們。接下來..........的答案(呵呵,不要用純文本存儲密碼)+'mysql_ *'combined = ['確定hack'](http://stackoverflow.com/q/60174 /)。另外,使用'GET'在地址欄中通告密碼,順便說一句。換句話說,**「不要使用此代碼」。** ---旁註:'&&'優先於'AND' –
@scrowler:'=='在PHP中很棘手,我不會所以肯定它.. :) –
@KarolyHorvath - touche,https://eval.in/92553 –