-1

我清理了,这是错误:

// validation expected data exists
if (!isset($_POST['name'])) { ||
    /* !isset($_POST['last_name']) || */
    !isset($_POST['email']) ||
    /* !isset($_POST['telephone']) || */
    !isset($_POST['comments']) 
died('We are sorry, but there appears to be a problem with the form you submitted.');   

错误说:

解析错误:语法错误,第 37 行 /home/kcorchid/public_html/Tap/Send_Comments.php 中的意外 T_BOOLEAN_OR ...

该行是:

if (!isset($_POST['name'])) { ||
4

2 回答 2

1

可重复使用且易于更改:

$must_exist = array('name','email','comments','last_name','telephone');

foreach ($must_exist as $item) {
    if (!isset($_POST[$item])) {
        die('We are sorry, but there appears to be a problem with the form you submitted.');
    }
}

// if code executes past this point, all the $must_exist items were found
于 2013-04-03T20:25:14.553 回答
0

你只是在错误的地方放了一个支架:

if (!isset($_POST['name']) ||
                                               /*!isset($_POST['last_name']) || */
    !isset($_POST['email']) ||
                                               /*!isset($_POST['telephone']) || */
    !isset($_POST['comments']) )
{
    die('We are sorry, but there appears to be a problem with the form you submitted.');
}

应该工作得很好!

于 2013-04-03T20:23:28.993 回答