![](/img/trans.png)
[英]Parse error: syntax error, unexpected '==' (T_IS_EQUAL), expecting ',' or ')'
[英]PHP Parse error: syntax error, unexpected T_IS_EQUAL, expecting
我收到以下錯誤:
PHP Parse error: syntax error, unexpected T_IS_EQUAL, expecting ','
or ')' in C:\etc\display.php on line 115
display.php的115行:
if ((!isset($_POST['login']==NULL) OR !isset($_POST['passwd']==NULL))) msgerror("<font size=4>Fill all the missing fields and try again.</font>");
我確定這是使用ISSET的語法問題,但我無法擺脫此錯誤並使之正常工作(很抱歉成為這樣的新手)。
只需刪除==NULL
,它們是完全不必要的,而且我不確定我為什么可以將它們放在第一位...
另外,最好使用||
代替or
應該
if ( !isset($_POST['login']) || !isset($_POST['passwd']) ) {
msgerror("Fill all the missing fields and try again.");
}
有關isset
更多信息: http : //php.net/manual/zh/function.isset.php
邏輯運算符: http : //php.net/manual/zh/language.operators.logical.php
嘗試這個 :
if (!isset($_POST['login']) || empty($_POST['login']) || !isset($_POST['passwd']) || empty($_POST['passwd']))
msgerror("<font size=4>Fill all the missing fields and try again.</font>");
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.