設置此變量會給出錯誤; 我嘗試一切可能的方式,但我無法調試:
>1. $_SESSION[clas = $_POST['clas']]; ERROR Parse error: syntax error, unexpected '=', expecting ']' in C:\wamp\www\st_db_1\search_db.php on line 51
>2. $_SESSION['clas = $_POST['clas']']; ERROR Parse error: syntax error, unexpected T_STRING, expecting ']' in C:\wamp\www\st_db_1\search_db.php on line 51
>3 $_SESSION['clas = $_POST[clas]']; ERROR Notice: Undefined index: clas = $_POST[clas] in C:\wamp\www\st_db_1\search_db.php on line 51
>4 $_SESSION[clas = $_POST[clas]]; ERROR Parse error: syntax error, unexpected '=', expecting ']' in C:\wamp\www\st_db_1\search_db.php on line 51
請建議我的東西。
這些都是在你的代碼Ravi簡單的語法錯誤,所以我建議你先研究語法。從這裏開始的好地方是http://www.w3schools.com/php/default.asp – Hafiz 2013-01-03 15:31:11