www.webdeveloper.com
Results 1 to 13 of 13

Thread: PHP issue with mailer submission form

Hybrid View

  1. #1
    Join Date
    Nov 2012
    Posts
    6

    PHP issue with mailer submission form

    I have a quick quote submission form on my site that is hosted by Go daddy and recently stopped working properly. It still sends the email when someone submits but the email shows up without the users information like the following:

    Name:
    Email:
    Phone Number:
    Date:
    Occasion:
    Number of People:
    Comments:

    It worked great for around 1.5 years previously and nothing has changed on the site since 2010. I checked the code and everything looks good. I really think it's a problem on the Go Daddy side since it was working fine for so long and nothing was changed but could you guys please look at the code and see if anything looks out of place. Thanks!

    Here’s the form:

    Code:
    <form id=”form1″ name=”form1″ method=”post” action=”http://www.southsidelimo.com/Scripts/quickquote.php”>
    <table border=”0″ cellpadding=”6″ cellspacing=”10″>
    <tr>
    <td align=”right”><label for=”name”>Name:</label></td>
    <td align=”left”><input name=”name” type=”text” id=”name” size=”28″ /></td>
    </tr>
    <tr>
    <td align=”right”><label for=”email”>Email Address:</label></td>
    <td align=”left”><input name=”email” type=”text” id=”email” size=”28″ /></td>
    </tr>
    <tr>
    <td align=”right”><label for=”phone”>Phone #:</label></td>
    <td align=”left”><input name=”phone” type=”text” id=”phone” size=”28″ /></td>
    </tr>
    <tr>
    <td align=”right”><label for=”date”>Service Date:</label></td>
    <td align=”left”><input name=”date” type=”text” id=”date” size=”28″ /></td>
    </tr>
    <tr>
    <td align=”right”><label for=”occasion”>Type of Occasion:</label></td>
    <td align=”left”><input name=”occasion” type=”text” id=”occasion” size=”28″ /></td>
    </tr>
    <tr>
    <td align=”right”><label for=”people”>Number of People:</label></td>
    <td align=”left”><input name=”people” type=”text” id=”people” size=”28″ /></td>
    </tr>
    <tr>
    <td align=”right”><label for=”comments”>Details:</label></td>
    <td align=”left”><textarea name=”comments” id=”comments” cols=”22″ rows=”4″></textarea></td>
    </tr>
    <tr>
    <td align=”right”> </td>
    <td align=”left”><label for=”submit”></label>
    <input name=”submit” type=”submit” id=”submit” onclick=”MM_validateForm(‘name’,”,’R',’email’,”,’RisEmail’,'date’,”,’R',’occasion’,”,’R');return document.MM_returnValue” value=”Submit Form” /></td>
    </tr>
    </table>
    </form>


    Here's the PHP Script:

    Code:
    <?php
    
    	$emailSubject = 'Customer Quick Quote Web Request';
    	$webMaster = 'myemail@gmail.com';	
    	
    	$nameField = $_POST['name'];	
    	$emailField = $_POST['email'];
    	$phoneField = $_POST['phone'];
    	$dateField = $_POST['date'];
    	$occasionField = $_POST['occasion'];
    	$peopleField = $_POST['people'];
    	$commentsField = $_POST['comments'];	
    	
    	$body = <<<EOD
    <br><hr><br>
    Name: $name <br>
    Email: $email <br>
    Phone Number: $phone <br>
    Date: $date <br>
    Occasion: $occasion <br>
    Number of People: $people <br>
    Comments: $comments <br>
    EOD;
    
    	$headers = "From: $email\r\n";
    	$headers .= "Content-type: text/html\r\n";
    	$success = mail($webMaster, $emailSubject, $body, $headers);	
    	$theResults = <<<EOD
    	
    	
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Southside Limousine...</title>
    <style type="text/css">
    <!--
    body {
    	background-color: #920C96;
    	background-image: url(images/bg.jpg);
    	background-repeat: repeat-x;
    	background-attachment: fixed;
    	text-align: center;
    	font-weight: bold;
    	}
    -->
    </style>
    <link href="css/layout.css" rel="stylesheet" type="text/css" />
    </head>
    
    <body>
    <p>&nbsp;</p>
    <p>&nbsp;</p>
    <p>&nbsp;</p>
    <p>&nbsp;</p>
    <p>&nbsp;</p>
    <p>&nbsp;</p>
    <p>&nbsp;</p>
    <p>Thank you for your interest.</p>
    <p>We will contact you shortly.</p>
    <p>&nbsp;</p>
    <p><a href="http://www.southsidelimo.com">RETURN HOME</a></p>
    </body>
    </html>
    EOD;
    echo "$theResults";
    
    ?>

  2. #2
    Join Date
    Nov 2012
    Posts
    6
    I have just experience the same problem with a different host. I am waiting to hear from the host if they have updated anything in the last couple of days.

  3. #3
    Join Date
    Nov 2012
    Posts
    6
    I posted on another forum and it was suggested that perhaps the PHP version was upgraded on the host and I should change the body section of the PHP code to the following:

    Code:
    $body = <<<EOD
    <br><hr><br>
    Name: $nameField <br>
    Email: $emailField <br>
    Phone Number: $phoneField <br>
    Date: $dateField <br>
    Occasion: $occasionField <br>
    Number of People: $peopleField <br>
    Comments: $commentsField <br>
    EOD;
    I will test it later tonight and report back. I did speak with Go Daddy and they say nothing changed on their end so we will see what happens.

  4. #4
    Join Date
    Nov 2012
    Posts
    6
    I just heard back form my host. They just moved to a new server with latest PHP 5.4 and MySQL 5.5.

  5. #5
    Join Date
    Nov 2012
    Posts
    6
    Great, did you find out what needs to be changed to fix the issue?

  6. #6
    Join Date
    Nov 2012
    Posts
    6
    Quote Originally Posted by sslimo View Post
    Great, did you find out what needs to be changed to fix the issue?
    Not yet. Based on the fact that the problem is happening with 2 different hosts my guess is that it is something the new version of PHP (5.4.8) that just came out this month. Unfortunately, I am no expert so it is an un-educated guess.

  7. #7
    Join Date
    Nov 2012
    Posts
    6
    Someone on another forum recommended I change the body of the PHP code to the following:

    Code:
    $body = <<<EOD
    <br><hr><br>
    Name: $nameField <br>
    Email: $emailField <br>
    Phone Number: $phoneField <br>
    Date: $dateField <br>
    Occasion: $occasionField <br>
    Number of People: $peopleField <br>
    Comments: $commentsField <br>
    EOD;
    I'll try it tonight and see if it works.

    BTW Go Daddy claims nothing has changed on their end in the last few months

  8. #8
    Join Date
    Nov 2012
    Posts
    6
    It appears that the problem is only occurring with <input type=text . The other types are still storing input.

  9. #9
    Join Date
    Nov 2012
    Posts
    6
    Well I figured it out. It seems if I try and include the submitted email in the body anywhere then none of the submitted data is included.

    For example if I make the body this excluding the $emailField:
    Code:
    $body = <<<EOD
    <br><hr><br>
    Name: $nameField <br>
    Phone Number: $phoneField <br>
    Date: $dateField <br>
    Occasion: $occasionField <br>
    Number of People: $peopleField <br>
    Comments: $commentsField <br>
    EOD;
    it works fine and even includes the source email in the from field.

  10. #10
    Join Date
    Nov 2012
    Posts
    6
    So, did your code change recently?

  11. #11
    Join Date
    Nov 2012
    Posts
    6
    My forms are now working. It looks like our host found the problem.

  12. #12
    Join Date
    Nov 2012
    Posts
    6
    Nope code hasn't changed since 2010.

    Glad to hear you got your issue sorted out.

  13. #13
    Join Date
    Oct 2012
    Posts
    17
    I think you should update your PHPMailer version with 5.1, because there might be issues with the older at hosting sites.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles