开发者

when all fields are empty, echo and exit - by newbie

Please tell me what needs to be done, to avoid the message:

Parse error: syntax error, unexpected $end in /xxxx/xxxxxxx/public_html/contact-    it/feedback.php on line xxx (the last line of feedback.php = ?>)

Thanks to all for any hint.

if(empty($data_start)) { 
    if(empty($data_end)) { 开发者_Go百科
        if(empty($comment)) { 
        # all empty 
echo "You have not specified any details to submit to us";
    exit ;

?>


You are missing closing curly braces:

if(empty($data_start)) { 
    if(empty($data_end)) { 
        if(empty($comment)) { 
        # all empty 
echo "You have not specified any details to submit to us";
    exit();
}}}

You should re-factor your code like this:

if(empty($data_start) && empty($data_end) && empty($comment)){
    exit("You have not specified any details to submit to us");
}

More Info:

  • http://www.w3schools.com/PHP/php_operators.asp
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜