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 8 of 8
  1. #1
    New to the CF scene
    Join Date
    Jan 2010
    Posts
    5
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Contact form not working in IE but fine in Firefox... Help!

    Hi everyone,

    I'm having a problem that is pulling my hair out. I have made a contact form that works perfect in Firefox, it sends the email and directs the user to the thankyou page which is "contactthanks.html", but it will not do either in IE. It won't even send the mail and it just comes up "blarg!".

    Can anyone help me? I've looked at so many tutorials to find out what the problem is but can't seem to sort it out... I'm not a PHP expert but I'm thinking there's probably something minor that IE doesn't like and I just cant figure it out, any ideas? Here's my code:

    HTML:
    Code:
    <form method="POST" action="mailer.php"  class="cssform3">
    <p><label>Your Name:</label><input type="text" name="name" /></p>
    <p><label>Your Email:</label><input type="text" name="email" /></p>
     <p><label>Your Message:</label><textarea name="message"></textarea></p>
     <input type="image" value="Submit" name="submit" class="submitbtn" src="images/submit.gif" >
     </form>
    PHP
    PHP Code:
    <?php
    if(isset($_POST['submit'])) {

    $to "myemail@gmail.com";
    $subject "Contact Form";
    $name_field $_POST['name'];
    $email_field $_POST['email'];
    $message $_POST['message'];
     
    $body "From: $name_field\n E-Mail: $email_field\n Message:\n $message";
     
    mail($to$subject$body);
    Header("Location: contactthanks.html");
    } else {

    echo 
    "blarg!";

    }
    ?>
    Thanks in advance for any help or ideas on whats up with this! As I said, FF is fine, just IE seems to not like it... Thanks!

  • #2
    Senior Coder angst's Avatar
    Join Date
    Apr 2004
    Location
    Toronto, Ontario
    Posts
    2,114
    Thanks
    15
    Thanked 122 Times in 122 Posts
    what version of IE?

    try changing the submit button like:

    Code:
     <input type="submit" value="Submit" name="submit" />
    try that and see if it works in IE, I'm not sure that IE sees an input type image as a submit button.

  • Users who have thanked angst for this post:

    claireym (01-22-2010)

  • #3
    New to the CF scene
    Join Date
    Jan 2010
    Posts
    5
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Hey there,

    Thankyou so so much, it works!! You were right, that's all that was wrong! Thanks so much!

  • #4
    Regular Coder
    Join Date
    Dec 2009
    Location
    UK
    Posts
    495
    Thanks
    0
    Thanked 58 Times in 58 Posts
    Wow didn't know that IE didn't support the image input. That must not be true for the latest versions. Is the version IE6
    My site: JayGilford.com
    Resources:
    PHP Pagination Class | Getting all page links | Handling PHP Errors properly
    If you like a users help, show your appreciation with the rep and thanks buttons :)

  • #5
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,866
    Thanks
    160
    Thanked 2,224 Times in 2,211 Posts
    Quote Originally Posted by angst View Post
    what version of IE?

    try changing the submit button like:

    Code:
     <input type="submit" value="Submit" name="submit" />
    try that and see if it works in IE, I'm not sure that IE sees an input type image as a submit button.
    Quote Originally Posted by claireym View Post
    Hey there,

    Thankyou so so much, it works!! You were right, that's all that was wrong! Thanks so much!
    Ah wait! An input having type="image" can submit a form, just like the one having type="submit"

    The problem lies in the isset() part. The image input submits the x and y coordinates of the user click. Thus you need to check for the submit_x or submit_y variables in the $_POST array, read http://php.net/manual/en/language.va...al.form.submit
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)

  • #6
    Regular Coder
    Join Date
    Dec 2009
    Location
    UK
    Posts
    495
    Thanks
    0
    Thanked 58 Times in 58 Posts
    Ah that sounds more like it
    My site: JayGilford.com
    Resources:
    PHP Pagination Class | Getting all page links | Handling PHP Errors properly
    If you like a users help, show your appreciation with the rep and thanks buttons :)

  • #7
    New to the CF scene
    Join Date
    Jan 2010
    Posts
    5
    Thanks
    1
    Thanked 0 Times in 0 Posts
    The version was IE8 although it would not work in IE7 either but it's all working now! Thanks guys!

  • #8
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,866
    Thanks
    160
    Thanked 2,224 Times in 2,211 Posts
    Quote Originally Posted by claireym View Post
    The version was IE8 although it would not work in IE7 either but it's all working now! Thanks guys!
    Did you see my post above?
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)


  •  

    Posting Permissions

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