views:

570

answers:

1

Hi all, I have a small "contact form" with jquery validation, php and ajax. My website running on IIS.

The problem is, I am trying to post the form contents using ajax+jquery, but I am getting the response like "405 Method Not Allowed" (From firebug console).

But its running properly in local server. Pls help me to fix 405 error. Thanks in advance.

Here's the js code while submitting the form:

$("#contactusForm").validate({

    rules:
    {
        firstName:{required:true},
                     email:{required :true},            
    },

    messages: 
    {
        firstName:{required: " *Required"},
        email:{ required:" *Required"},
    },

    submitHandler: function (form) 
    {

        var dataString='firstName='+ firstName  + '&email=' + email;
        $.ajax({  
             type: "POST",  
             url: "send_contact.php",  
             data: dataString,


             success: function() {  
                 $('#result').html("<br/><b>Thank you</b>");  

             }
         }); 
}
});
A: 

What server are you using? Apache? IIS?

JeremySpouken
Anyhow, 405 errors can arise because the Web server is not configured to take data from the client at all. They can also arise if the client does not have sufficient authority to the particular URL resource identified on the request.
JeremySpouken
I am using iis server
Ra
Do you have the PHP ISAPI module installed? IIS doesn't support PHP out of the box.
JeremySpouken