Why am I getting undefined function in my script?
<p>I am having some trouble with a PHP contact form, when submitted this form returns only 
phone number: and also enquiry: undefined . It should return Name, Phone Number and my Enquiry. Any idea why its not returning name and why Enquiry is undefined?</p>

<p><strong>MY PHP</strong> 
    

<pre><code>    $name=$_POST['name'];
    $phone=$_POST['phone'];
    $enquiry=$_POST['enquiry'];

    $subject="NINJA2k - EMAIL INQUIRY FROM: $name";
    $message="
          Phone:&lt;br&gt;
          &lt;strong&gt;$phone&lt;/strong&gt;&lt;br&gt;
          &lt;br&gt;
          Enquiry:&lt;br&gt;
          &lt;strong&gt;$enquiry&lt;/strong&gt;&lt;br&gt;
          &lt;br&gt;
    ";

    mysql_close();

    include("class.phpmailer.php");
    include("class.smtp.php");

    $mail = new PHPMailer();
    $mail-&gt;IsSMTP();// send via SMTP
    $mail-&gt;Host = "localhost"; // SMTP servers
    $mail-&gt;SMTPAuth = false; // turn on/off SMTP authentication
    $mail-&gt;From = "user1@mydomain.com";
    $mail-&gt;FromName = "http://mail.mydomain.com/";
    $mail-&gt;AddAddress("user1@mydomain.com");
    $mail-&gt;AddReplyTo("user1@mydomain.com");
    $mail-&gt;WordWrap = 50;// set word wrap
    //now Attach all files submitted

    $mail-&gt;Body = $message;
    //
    $mail-&gt;IsHTML(true);// send as HTML
    $mail-&gt;Subject = $subject;


    if($mail-&gt;Send()) 
    {
        echo "Thank You &lt;b&gt;$name&lt;/b&gt;&lt;br&gt;Your email has been sent.";
    } 
    else 
    {
        echo "There was a problem sending the mail. Please check that you filled in the form correctly.";
    }
?&gt;

$('.contact_form').dialog({
        width:500,
        height:450,
        modal:true,
        buttons: {
            "Send": function() {
                if(($("#ct_name").val()=="") || ($("#ct_phone").val()=="") || ($("#ct_enquiry").val()=="") || ($("#ct_captcha").val()==""))
                    alert("You must fill all the field");
                else
                {
                    var capt=$(div_list[ind]).attr("id");
                    if(capt!=$("#ct_captcha").val().toLowerCase())
                        alert("Captcha Code is Invalid!");
                    else
                    {
                        var send_string;
                        send_string="name=";
                        send_string+=$("#ct_name").val();
                        send_string+="&amp;phone=";
                        send_string+=$("#ct_phone").val();
                        send_string+="&amp;enquiry=";
                        send_string+=$("#ct_enquiry").val();

                        $.ajax({
                             type: "POST",
                             url: "send_mail.php",
                             data:   send_string,
                             async: false,
                             success: function(msg){ 
                                alert("Your mail was sent successfully!");
                             } ,
                             error: function(msg){
                                alert("Sorry! We couldn't send email"); 
                             }
                        }); 
                    }
                }

            }
        }
    });
</code></pre>

<p><strong>MY HTML</strong></p>

<pre><code>    &lt;div class="contact_form" title="Dialog Title" style="display:none"&gt;
    &lt;table width="100%" style="padding:30px"&gt;
        &lt;tr&gt;&lt;td&gt;Name&lt;/td&gt;&lt;td&gt;&lt;input type="text" id="ct_name"/&gt;&lt;/td&gt;&lt;/tr&gt;
        &lt;tr&gt;&lt;td&gt;Phone Number&lt;/td&gt;&lt;td&gt;&lt;input type="text" id="ct_phone"/&gt;&lt;/td&gt;&lt;/tr&gt;
        &lt;tr&gt;&lt;td&gt;Enquiry Data&lt;/td&gt;&lt;td&gt;&lt;textarea rows="4"&gt;&lt;/textarea&gt;&lt;/td&gt;&lt;/tr&gt;
        &lt;tr&gt;
        &lt;td&gt;Captcha&lt;/td&gt;
        &lt;td&gt;
            &lt;div&gt;
                &lt;div class="captcha" id="28ivw"&gt;&lt;img src="images/captcha1.png" /&gt;&lt;/div&gt;
                &lt;div class="captcha" id="k4ez"&gt;&lt;img src="images/captcha2.png" /&gt;&lt;/div&gt;
                &lt;div class="captcha" id="jw62k"&gt;&lt;img src="images/captcha3.png" /&gt;&lt;/div&gt;
                &lt;div class="captcha" id="fh2de"&gt;&lt;img src="images/captcha4.png" /&gt;&lt;/div&gt;
                &lt;div class="captcha" id="gwprp"&gt;&lt;img src="images/captcha5.png" /&gt;&lt;/div&gt;
                &lt;div class="captcha" id="4d7ys"&gt;&lt;img src="images/captcha6.png" /&gt;&lt;/div&gt;
                &lt;div class="captcha" id="e5hb"&gt;&lt;img src="images/captcha7.png" /&gt;&lt;/div&gt;
                &lt;div class="captcha" id="xmqki"&gt;&lt;img src="images/captcha8.png" /&gt;&lt;/div&gt;
                &lt;div class="captcha" id="6ne3"&gt;&lt;img src="images/captcha9.png" /&gt;&lt;/div&gt;
                &lt;div class="captcha" id="xdhyn"&gt;&lt;img src="images/captcha10.png" /&gt;&lt;/div&gt;
                &lt;div class="captcha" id="q98p"&gt;&lt;img src="images/captcha11.png" /&gt;&lt;/div&gt;
                &lt;div class="captcha" id="hrai"&gt;&lt;img src="images/captcha12.png" /&gt;&lt;/div&gt;
            &lt;/div&gt;
            &lt;input type="text" style="margin-top:15px" id="ct_captcha"/&gt;
        &lt;/td&gt;
        &lt;/tr&gt;
    &lt;/table&gt;
&lt;/div&gt;
</code></pre>
