调用PHP函数error_message()时发生致命错误

调用PHP函数error_message()时发生致命错误,php,error-handling,Php,Error Handling,没有任何函数具有此名称错误\u消息,请使用 对不起,我的英语不好。那么错误信息是什么?为什么不直接输入所需的电子邮件地址;是的,这也有,但我正在尝试缓冲电子邮件和其他未刷新的邮件,当我执行FormThank时,它解决了致命错误消息,但我不知道为什么wrox发布php5时会给出错误消息function@AmitSoni可能是使用此名称创建的自定义函数。数组中的堆叠方式非常好,但当我实现代码时,它会抛出异常uncaught,致命错误:未捕获异常“exception”并显示消息“Enter First

没有任何函数具有此名称错误\u消息,请使用


对不起,我的英语不好。

那么错误信息是什么?为什么不直接输入所需的电子邮件地址;是的,这也有,但我正在尝试缓冲电子邮件和其他未刷新的邮件,当我执行FormThank时,它解决了致命错误消息,但我不知道为什么wrox发布php5时会给出错误消息function@AmitSoni可能是使用此名称创建的自定义函数。数组中的堆叠方式非常好,但当我实现代码时,它会抛出异常uncaught,致命错误:未捕获异常“exception”并显示消息“Enter First Name”,这是指向抛出新异常如果数组中的值返回空,则会触发抛出新异常$key,并在$key变量中获取消息。我是如何捕获此异常的,因为其中一个值​​在序列中,所有的都是空的。
<?php

if (isset($_POST['Submit'])) {
    /* here i am getting variable from form */


    $Post = $_POST["Post"];
    $Fname = $_POST["Fname"];
    $Lname = $_POST["Lname"];
    $Sex = $_POST["Sex"];
    $Marital = $_POST["Mstatus"];
    $Father = $_POST["Father"];
    $Mother = $_POST["Mother"];
    $Husband = $_POST["Hname"];
    $Marital = $_POST["Mstatus"];
    $Spouse = $_POST["Sname"];
    $Son = $_POST["Nson"];
    $Daughter = $_POST["Ndaughter"];
    $Blood = $_POST["Bgroup"];
    $Language = $_POST["Lang"];
    $Dob = $_POST["Dob"];
    $Occu = $_POST["Occu"];
    $Qualification = $_POST["Hqualification"];
    $Nation = $_POST["Nationality"];
    $Conv = $_POST["Conv"];
    $Mobile = $_POST["Mobile"];
    $Email = $_POST["Email"];
    $Income = $_POST["Aincome"];
    $Pass = $_POST["Pass"];
    $Pass_num = $_POST["Passport_num"];
    $Voter = $_POST["Voter"];
    $Voter_num = $_POST["Voter_num"];
    $Address = $_POST["Address"];



    $sql = "INSERT INTO `boward`.`register` (`Post`, `Fname`, `Lname`, `Sex`, `Mstatus`, `Father`, `Mother`, `Hname`, `Sname`, `Nson`, `Ndoughter`, `Bgroup`, `Lang`, `Dob`, `Occu`, `Hqualification`, `Nationality`, `Nationality_other`, `Conv`, `Mobile`, `Email`, `Aincome`, `Pass`, `Passport_num`, `Voter`, `Voter_num`, `Address`, `pic`) VALUES ('$Post', '$Fname', '$Lname', '$Sex', '$Marital', '$Father', '$Mother', '$Husband', '$Marital', '$Spouse', '$Son', '$Daughter', '$Blood', '$Language', '$Dob', '$Occu', '$Qualification', '$Nation', '$Conv', '$Mobile', '$Email', '$Income', '$Pass', '$Pass_num', '$Voter', '$Voter_num', '$Address', '')";

    global $default_dbname;
    $link_id = db_connect($default_dbname);

    /* here i am executing sql statement */

    if (empty($Email)) {
        /* this error_message function giving Fatal error when calling */

        error_message("Enter Desired E-mail Address");
    } else {
        $result = mysql_query($sql);
        echo "<center>Record Inserted</center>";
    }
}
?>
<?php

$Fname = $_POST["Fname"];
$Lname = $_POST["Lname"];
$Email = $_POST["Email"];

// you need $_POST controls

$ArrPost = Array( // They want to control the summer series.
                'Enter First Name'     => $Fname,
                'Enter Last Name'      => $Lname,
                'Enter E-mail Address' => $Email
                );

$i=0;
$count = count($ArrPost);
foreach($ArrPost as $key => $val)
{
    $i++;
    if(empty($val))
    {
        throw new Exception($key);
    }
    elseif($i == $count)
    {
        $result = mysql_query($sql);
        if($result)
            echo "<center>Record Inserted</center>";
    }
}