if ((isset($post["username"]) && isset($post["password"])) && (!empty($post["username"]) && !empty($post["password"])) && ($post["username"] == "something" && $post["password"] == "something"))
{
}
Error: syntax error, unexpected T_IF in [file_name here but I rather not expose the file path and name]什麼在PHP
不對的if語句我知道這是有點複雜,但有什麼不對的if語句,因爲我收到上述錯誤。雖然我檢查了幾次。
應該是前行中的錯誤。 – Sufendy
爲什麼你使用isset()和empty()?爲了簡化這些陳述,我通常會使用某種標記來了解提交公式的時間。通過這樣做,我只需要驗證用戶名和密碼的實際內容 –
if語句之前的唯一行是這個'<?php $ post = $ _POST'只需2行代碼。 – Tarik