当所有字段都为空时,回显并退出 - 由新手

时间:2010-10-08 12:26:13

标签: php

请告诉我需要做什么,以避免这个消息:

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

感谢所有提示。

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 ;

?>

1 个答案:

答案 0 :(得分:0)

您缺少关闭花括号:

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();
}}}

你应该重新考虑你的代码:

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

更多信息: