Php 电子邮件脚本中出现意外的T\u布尔值\u
我编写了一个脚本,将联系人表单的内容(名字、姓氏和电子邮件地址)发送给网站所有者。但是,当我按下表单上的“提交”按钮时,会出现以下错误:Php 电子邮件脚本中出现意外的T\u布尔值\u,php,forms,http-post,Php,Forms,Http Post,我编写了一个脚本,将联系人表单的内容(名字、姓氏和电子邮件地址)发送给网站所有者。但是,当我按下表单上的“提交”按钮时,会出现以下错误: Unexpected T_BOOLEAN_OR 是的。以下是参考行号附近的代码片段: function died($error) { echo "We are very sorry, but there were error(s) found with the form you submitted. "; echo "These errors
Unexpected T_BOOLEAN_OR
是的。以下是参考行号附近的代码片段:
function died($error) {
echo "We are very sorry, but there were error(s) found with the form you submitted. ";
echo "These errors appear below.<br /><br />";
echo $error."<br /><br />";
echo "Please go back and fix these errors.<br /><br />";
die(); }
// validation expected data exists
if(!isset($_POST['first_name']) ||
!isset($_POST['last_name']) ||
!isset($_POST['email'])) || {
died('We are sorry, but there appears to be a problem with the form you submitted.');
}
函数失效($error){
echo“非常抱歉,您提交的表单存在错误。”;
echo“这些错误出现在下面。
”;
echo$错误。“
”;
echo“请返回并修复这些错误。
”;
die();}
//验证预期数据存在
如果(!isset($_POST['first_name'])||
!isset($_POST['last_name'])|
!isset($_POST['email'])|{
死亡('很抱歉,您提交的表格似乎有问题');
}
非常感谢您的帮助:)
!isset($_POST['email']))|{!isset($_POST['email']))|{这是您的常规代码缩进样式吗?如果是这样,您可能应该采用标准程序,在卷曲中缩进行,在多行If语句中缩进半行,因为这两个步骤会使错误更加明显。这是您的常规代码缩进样式吗?如果是这样,您可能应该采用标准程序在卷曲中缩进行和在多行if语句中半缩进行的过程,因为这两个步骤会使错误更加明显。
!isset($_POST['email'])) || { <-- there's your problem