www.webdeveloper.com
Results 1 to 4 of 4

Thread: Contact form doesn't work on a new hosting plan

  1. #1
    Join Date
    Jul 2011
    Posts
    9

    Question Contact form doesn't work on a new hosting plan

    I'm having issues with this contact form. I've used it several different times with no problems on different hosting. Now when I put it on Godaddy it doesn't work. I even uploaded it to my own personal hosting and it works perfect.. Just not on godaddy. I'm not sure if there's a problem with the code or what. I'm lost of what it could be. Does anyone know what I should look for? I'm frustrated over here..

    Here's the code. It's simple..

    PHP Code:
    <?php
    if(isset($_POST['submit'])) {

    $to "lillizzierae@aol.com";
    $subject "Disney Contact Form";
    $name_field $_POST['name'];
    $phone_field $_POST['phone'];
    $email_field $_POST['email'];
    $message $_POST['message'];

    $body "From: $name_field\n E-Mail: $email_field\n Phone: $phone_field\n Message:\n $message";

    echo 
    "";
    mail($to$subject$body);

    } else {

    echo 
    "Go back";

    }
    ?>

    This is the form.

    Code:
    <form action="contactthanks.php" method="post">
    <table width="450" border="0" cellspacing="10">
    
    							<td width="440" align="left"><label for="name">*Name:</label><br /><input type="text" name="name" id="name" /></td>
      							</tr>
      							<tr>
        						<td align="left"><label for="city">Phone:</label>
        						  <br /><input type="text" name="city" id="city" /></td>
      							</tr>
      							<tr>
        						<td align="left"><label for="email">*Email:</label><br /><input type="text" name="email" id="email" /></td>
      							</tr>
      							<tr>
        						<td align="left"><label for="message">*Message:</label><br /><textarea name="message" rows="10" cols="40" id="message"></textarea></td>
      							</tr>
                                <td align="left"><label for="answer">*Type in the following answer to the question:<br />2 + 2 =</label><br /><input type="text" name="answer" id="answer" /></td>
      							<tr>
        						<td align="left"><input name="submit" type="submit" class="submit-button" onclick="MM_validateForm('name','','R','email','','RisEmail','answer','','RinRange4:4','message','','R');return document.MM_returnValue" value="Submit" /></td>
      							</tr>
    						</table>
    						</form>

  2. #2
    Join Date
    Jul 2010
    Posts
    11
    Are you receiving an error message or does it just act like the message was sent?

  3. #3
    Join Date
    Jul 2011
    Posts
    9
    It acts like the message was sent which makes me wonder if it's something with the hosting not the script.

  4. #4
    Join Date
    Jul 2010
    Posts
    11
    Could be the specific hosting package you're using that doesn't support the mail() function. Consider using PHPMailer which is a php class that avoids using the mail() function and also allows the use of SMTP (even with authentication).

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