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 3 of 3
  1. #1
    Regular Coder
    Join Date
    Jun 2009
    Posts
    351
    Thanks
    75
    Thanked 0 Times in 0 Posts

    how come this simple php mail script wont work in ie

    PHP Code:
             <?php  if(isset($_POST['submit']))
          {
          echo 
    "hello";
              
    $firstName $_POST['firstName'];
              
    $lastName $_POST['lastName'];
              
    $email $_POST['email'];
              
    $mobile $_POST['mobile'];
              
    $comments $_POST['comments'];

           
            
    $to "info@projectorhire.ie";
            
    $subject "Projector Hire Inquiry!";
            
    $body 
      
               
    "\nName: " $firstName " " $lastName .
               
    "\nEmail: " $email 
               
    "\nPhone Number: " $mobile 
               
    "\nMessage: " $comments;

            
    $headers "From: "$firstName ." "$lastName " <" $email ">\r\n";


           if (
    mail($to$subject$body$headers)) {
            echo(
    "<p class=\"errors\">Thanks for submitting your enquiry.</p>");
            }
            else {
            echo(
    "<p class=\"errors\">Message delivery failed. Please fill in or Quick Contact Form again or call us on 087-9850714 to get immediate assistance.</p>");
           }
        }
     
    ?>   
            </span>    
                     <form id="form" method="post" action="index.php#anchor" > 
                <p> 
                    <label>First Name</label>
                    <input type="text" id="firstName" name="firstName" value="" />      
                </p> 
                <p> 
                    <label>Last Name</label>
                    <input type="text" id="lastName" name="lastName" value="" />      
                </p> 
                <p> 
                    <label>Email:</label>
                    <input type="text" id="email" name="email" value="" /> 
                    
                </p>               
                <p> 
                    <label>Phone:</label>
                    <input type="text" id="mobile" name="mobile" value="" /> 
                    
                </p>                                  
                <p> 
                    <label>Comments:</label> 
                    <textarea name="comments" id="comment" cols="30" rows="3" ></textarea>    
                </p> 
                <p>    <input class="submit" type="image" src="images/submit.gif" name="submit" value="submit"  /></p> 
              </form>
    it works in firefox but not in Ie for some weird reason...

    Check www.projectorhire.ie for live version

    Let me know if you know what the problem is

    Thanks
    Last edited by kevinkhan; 03-22-2010 at 02:00 PM.

  • #2
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    Change this
    PHP Code:
    if(isset($_POST['submit'])) 
    to this
    PHP Code:
    if(isset($_POST['submit_x'])) 
    And it shoul work in all browsers. When using an input type="image" IE sends the x and y values of where the user clicked on the image. Firefox does this too but I believe it still sends the normal name of the button as well.
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • Users who have thanked _Aerospace_Eng_ for this post:

    kevinkhan (03-22-2010)

  • #3
    Regular Coder
    Join Date
    Jun 2009
    Posts
    351
    Thanks
    75
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by _Aerospace_Eng_ View Post
    Change this
    PHP Code:
    if(isset($_POST['submit'])) 
    to this
    PHP Code:
    if(isset($_POST['submit_x'])) 
    And it shoul work in all browsers. When using an input type="image" IE sends the x and y values of where the user clicked on the image. Firefox does this too but I believe it still sends the normal name of the button as well.
    That worked alright..

    Thats strange..

    Thanks


  •  

    Posting Permissions

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