Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    New to the CF scene
    Join Date
    Feb 2014
    Posts
    3
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Contact form problems

    I hope this is posted in the right part of this forum that I am new to.
    I am at a fairly basic level in web design and writing however I have written 5 sites for my self and clubs with out too many issues. This is the first time I have had a need to ask for help.

    All my sites I have written have a contact page with the data emailed to the appropriate recipient. A new site that is under construction (I only need to repeat into French, English is done) is causing me problems with the contact page. I have tried to resolve this and at the moment out of desperation I have exactly the same coding as one of my other sites ( copies & pasted, just changing the appropriate file names) but still the same error.

    The problem is when poste the php file returns this error;

    405 - HTTP verb used to access this page is not allowed.
    The page you are looking for cannot be displayed because an invalid method (HTTP verb) was used to attempt access.


    The contact form code is

    Code:
    <table bgcolor=#E0F8E0 align=center>
    
    <form action="send_mail_ALPS.php" method="post">
    <table bgcolor=#E0F8E0 align=center>
    <tr><td colspan=2><strong>Contact us using this form:</strong></td></tr>
    <tr><td> Name:<font color=red>*</font></td><td><input size=35 name="name"></td></tr>
    <tr><td> Email:<font color=red>*</font></td><td><input size=35 name="email_address"></td></tr>
    <tr><td>Post Code:<font color=red>*</font></td><td><input size=35 name="postcode"></td></tr>
    <tr><td>Phone:</td><td><input size=35 name="phone"></td></tr>
    
    <tr><td colspan=2>Message:</td></tr>
    <tr><td colspan=2 align=center><textarea name="message" rows=10 cols=40></textarea></td></tr>
    <tr><td colspan=2 align=center><input type="submit" value="Submit" /></td></tr>
    <tr><td colspan=2 align=center><small>A <font color=red>*</font> indicates a field is required</small></td></tr>
    </table>
    </form>
    and the php code is

    Code:
    <?php
    
    
    // Load data
    $name = $_REQUEST['name'] ;
    $email_address = $_REQUEST['email_address'] ;
    $postcode = $_REQUEST['postcode'] ;
    $phone = $_REQUEST['phone'] ;
    $message = $_REQUEST['message'] ;
    
    
    // Add concatenate variable to one with lables and line breaks
    $result = 
    "               Studio ENQUIRY          " . "\n" . "\n"  . "\n" .
    "NAME      " . $name  . "\n" . "\n" .
    "EMAIL     " . $email_address  . "\n" . "\n" .
    "POSTCODE  " . $postcode . "\n" . "\n" .
    "PHONE     " . $phone . "\n"  ."\n".
    "MESSAGE   " . $message;
    
    
    // If the form fields are empty, redirect to the error page.
    if (empty($email_address) || empty($postcode) || empty($message)) {
    print "You have not entered required information, please use your back button and try again";
    }
    
    
    // Send the email
    else {
    mail( "info@french-alpine-studio.com", "****Alpine Studio - Web Enquiry****",
    $result,
    "From: $email_address" );
    header( "Location: http://www.french-alpine-studio.com/thankyou_EN.html" );
    
    
    }?>
    my site is[URL="http://www.french-alpine-studio.com"[/URL]

    I will appreciate all help & thank you in advance.
    Tim

  • #2
    Master Coder
    Join Date
    Jun 2003
    Location
    Cottage Grove, Minnesota
    Posts
    9,500
    Thanks
    8
    Thanked 1,089 Times in 1,080 Posts
    I don't see anything wrong offhand, but there is something you can try ...

    You are using "post" method in your form.

    In PHP, you are using $_REQUEST. That would work with both "post" or "get", but $_REQUEST is deprecated. It's possible the PHP config/revision on their server doesn't like $_REQUEST

    Change all of your $_REQUEST to $_POST

    It's worth a shot, but may or may not correct the problem.

  • Users who have thanked mlseim for this post:

    TimFr (02-28-2014)

  • #3
    New to the CF scene
    Join Date
    Feb 2014
    Posts
    3
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by mlseim View Post
    I don't see anything wrong offhand, but there is something you can try ...

    You are using "post" method in your form.

    In PHP, you are using $_REQUEST. That would work with both "post" or "get", but $_REQUEST is deprecated. It's possible the PHP config/revision on their server doesn't like $_REQUEST

    Change all of your $_REQUEST to $_POST

    It's worth a shot, but may or may not correct the problem.
    Thank you for your reply Miseim
    I changed the $_REQUEST to $_POST and it made no difference.

    I just cant figure out the problem.

  • #4
    Master Coder
    Join Date
    Jun 2003
    Location
    Cottage Grove, Minnesota
    Posts
    9,500
    Thanks
    8
    Thanked 1,089 Times in 1,080 Posts
    Start commenting-out lines and see if the problem goes away after a certain line is commented.

    Like this line:

    header( "Location: http://www.french-alpine-studio.com/thankyou_EN.html" );

    Comment it out:

    //header( "Location: http://www.french-alpine-studio.com/thankyou_EN.html" );

  • #5
    New to the CF scene
    Join Date
    Feb 2014
    Posts
    3
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Problem solved

    For some reason web scripting was turned off


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •