开发者

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

开发者 https://www.devze.com 2023-01-19 01:23 出处:网络
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

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

精彩评论

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