Jump to content

Contact Form


mr.abuasbe
 Share

Recommended Posts

hi,

i'm trying to make contact form, i'm working with html and i have Linux server.

now when i press submit button i'm getting

HTTP Error 405.0 - Method Not Allowed
                   <form role="form" action="assets/contact.php" method="post">
                       <div class="form-group">
                           <label class="sr-only" for="contact-email">Email</label>
                           <input type="text" name="email" placeholder="Email..." class="contact-email form-control" id="contact-email">
                       </div>
                       <div class="form-group">
                           <label class="sr-only" for="contact-subject">Subject</label>
                           <input type="text" name="subject" placeholder="Subject..." class="contact-subject form-control" id="contact-subject">
                       </div>
                       <div class="form-group">
                           <label class="sr-only" for="contact-message">Message</label>
                           <textarea name="message" placeholder="Message..." class="contact-message form-control" id="contact-message"></textarea>
                       </div>
                       <div class="form-group">
                           <label for="contact-antispam">Antispam question: 7 + 5 = ?</label>
                           <input type="text" name="antispam" placeholder="Your answer..." class="contact-antispam form-control" id="contact-antispam">
                       </div>
                       <button type="submit" class="btn">Send message</button>
                   </form>
HTTP Error 405.0 - Method Not Allowed
The page you are looking for cannot be displayed because an invalid method (HTTP verb) is being used.

Most likely causes:
The request sent to the Web server used an HTTP verb that is not allowed by the module configured to handle the request.
A request was sent to the server that contained an invalid HTTP verb.
The request is for static content and contains an HTTP verb other than GET or HEAD.
A request was sent to a virtual directory using the HTTP verb POST and the default document is a static file that does not support HTTP verbs other than GET or HEAD.

Things you can try:
Verify the list of verbs enabled for the module handler this request was sent to, and ensure that this verb should be allowed for the Web site.
Check the IIS log file to see which verb is not allowed for the request.
Check the failed request tracing logs for additional information about this error. For more information, click here.

Detailed Error Information:
Module	   StaticFileModule
Notification	   ExecuteRequestHandler
Handler	   StaticFile
Error Code	   0x80070001
Requested URL	   http://localhost:35840/assets/contact.php
Physical Path	   C:\Users\Omar\Desktop\XPOZ\assets\contact.php
Logon Method	   Anonymous
Logon User	   Anonymous
Request Tracing Directory	   C:\Users\Omar Abu Asbe\Documents\IISExpress\TraceLogFiles\XPOZ

More Information:
This error means that the request sent to the Web server contained an HTTP verb that is not allowed by the configured module handler for the request.
View more information »

ANY HELP ?!

  • Like 1
Link to comment
Share on other sites

this my contact.php

jQuery(function($)  
{
    $("#contact_form").submit(function()
    {
        var email = $("#email").val(); // get email field value
        var name = $("#name").val(); // get name field value
        var msg = $("#msg").val(); // get message field value
        $.ajax(
        {
            type: "POST",
            url: "https://mandrillapp.com/api/1.0/messages/send.json",
            data: {
                'key': 'sVRLFidC1A7K56TuUkyUQg',
                'message': {
                    'from_email': email,
                    'from_name': name,
                    'headers': {
                        'Reply-To': email
                    },
                    'subject': 'Website Contact Form Submission',
                    'text': msg,
                    'to': [
                    {
                        'email': 'mr.abuasbe@gmail.com',
                        'name': 'Riyadh Al Nur',
                        'type': 'to'
                    }]
                }
            }
        })
        .done(function(response) {
            alert('Your message has been sent. Thank you!'); // show success message
            $("#name").val(''); // reset field after successful submission
            $("#email").val(''); // reset field after successful submission
            $("#msg").val(''); // reset field after successful submission
        })
        .fail(function(response) {
            alert('Error sending message.');
        });
        return false; // prevent page refresh
    });
});

and windows iis is disabled ! (see attached photo)

post-196666-0-88017400-1454079940_thumb.png

Link to comment
Share on other sites

Don't believe such thing really means its fully disabled... we are talking about MS here :-)

 

Check in control panel -> Administrator tools -> Services -> scroll down to World Wide Publishing Service does it still exist? if so does it show as disabled.

 

Also you might have problem transferring from 'http' to 'https', it treated as not secure, and usually throws error.

Link to comment
Share on other sites

i tried now this code from the web, and the same problem ..

i can't run it ... (i'm trying locally now)

<?php
$field_name = $_POST['cf_name'];
$field_email = $_POST['cf_email'];
$field_message = $_POST['cf_message'];

$mail_to = 'mr.abu@gmail.com';
$subject = 'Message from a site visitor '.$field_name;

$body_message = 'From: '.$field_name."\n";
$body_message .= 'E-mail: '.$field_email."\n";
$body_message .= 'Message: '.$field_message;

$headers = 'From: '.$field_email."\r\n";
$headers .= 'Reply-To: '.$field_email."\r\n";

$mail_status = mail($mail_to, $subject, $body_message, $headers);

if ($mail_status) { ?>
	<script language="javascript" type="text/javascript">
		alert('Thank you for the message. We will contact you shortly.');
		window.location = 'contact_page.html';
	</script>
<?php
}
else { ?>
	<script language="javascript" type="text/javascript">
		alert('Message failed. Please, send an email to gordon@template-help.com');
		window.location = 'contact_page.html';
	</script>
<?php
}
?>
      <form action="contact.php" method="post">
                       Your name<br>
                       <input type="text" name="cf_name"><br>
                       Your e-mail<br>
                       <input type="text" name="cf_email"><br>
                       Message<br>
                       <textarea name="cf_message"></textarea>
                           <br>
                           <input type="submit" value="Send">
                           <input type="reset" value="Clear">
                   </form>    
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...