Php form submission with GoDaddy hosted website?


I have been using the same php script for my contact pages for almost all my sites, but it doesn’t seem to work on a site that I am doing that is hosted with Go Daddy…

Is this a common problem? If so can someone point me to a script that will work? I tried google but couldn’t find anything solid.


Would be mighty hard helping without seeing the code that this “contact form” uses.


The problem is after the form submits, it is redirecting back to the home page instead of the thanks.php page.

Here is the code on the actual contact.php page

		<form method="POST" action="gdform.php">
<div id="contactbox">

	<div id="contactsp">
			<p>First Name: </p>	
			<p>Last Name: </p>	
			<p>Company: </p>		
			<p>Address 1: 	</p>	
			<p>Address 2: </p>		
			<p>City: 	</p>	
			<p>State: 	</p>	
			<p>Zip: 	</p>	
			<p>Email: </p>		
			<p>Phone: </p>			
	<div id="contactsp2">
			<p><input type="text" name="FirstName"></p>
			<p><input type="text" name="LastName"></p>
			<p><input type="text" name="Company"></p>
			<p><input type="text" name="Address1"></p>
			<p><input type="text" name="Address2"></p>
			<p><input type="text" name="City"></p>
			<p><input type="text" name="State"></p>
			<p><input type="text" name="Zip"></p>
			<p><input type="text" name="EmailFrom"></p>
			<p><input type="text" name="Phone"></p>
		    <p><textarea rows="4" name="Comment"></textarea></p>
			<p><input type="submit" name="submit" value="Submit"></p>


And here is the gdform.php page


$EmailFrom = Trim(stripslashes($_POST['EmailFrom'])); 
$EmailTo = "erik@***.com, drew@***.com";
$Subject = "Inquiry from ***.com";
$FirstName = Trim(stripslashes($_POST['FirstName'])); 
$LastName = Trim(stripslashes($_POST['LastName'])); 
$Company = Trim(stripslashes($_POST['Company'])); 
$Address1 = Trim(stripslashes($_POST['Address1'])); 
$Address2 = Trim(stripslashes($_POST['Address2'])); 
$City = Trim(stripslashes($_POST['City'])); 
$State = Trim(stripslashes($_POST['State'])); 
$Zip = Trim(stripslashes($_POST['Zip'])); 
$Phone = Trim(stripslashes($_POST['Phone'])); 
$Comment = Trim(stripslashes($_POST['Comment'])); 

if (Trim($EmailFrom)=="") $validationOK=false;
if (!$validationOK) {
  print "<meta http-equiv=\\"refresh\\" content=\\"0;URL=error.php\\">";

$Body = "";
$Body .= "FirstName: ";
$Body .= $FirstName;
$Body .= "\
$Body .= "LastName: ";
$Body .= $LastName;
$Body .= "\
$Body .= "Company: ";
$Body .= $Company;
$Body .= "\
$Body .= "Address1: ";
$Body .= $Address1;
$Body .= "\
$Body .= "Address2: ";
$Body .= $Address2;
$Body .= "\
$Body .= "City: ";
$Body .= $City;
$Body .= "\
$Body .= "State: ";
$Body .= $State;
$Body .= "\
$Body .= "Zip: ";
$Body .= $Zip;
$Body .= "\
$Body .= "Phone: ";
$Body .= $Phone;
$Body .= "\
$Body .= "Comment: ";
$Body .= $Comment;
$Body .= "\

$success = mail($EmailTo, $Subject, $Body, "From: <$EmailFrom>");

if ($success){
  print "<meta http-equiv=\\"refresh\\" content=\\"0;URL=thanks.php\\">";
  print "<meta http-equiv=\\"refresh\\" content=\\"0;URL=error.php\\">";

Is anyone able to help with this? Or have had a similar problem with a GoDaddy site?


Have you tried putting in the full domain path instead of just the uri?

[COLOR=#000000]print [COLOR=#dd0000]"<meta http-equiv=\“refresh\” content=\"0;URL=\\“&gt;”[/COLOR][COLOR=#007700];[/COLOR][/COLOR]

I’ve had a lot of issues with GoDaddy and PHP, so I know your pain. I have heard the mail() function just doesn’t work sometimes.

You could try using GoDaddy’s form mailers if they suit your needs:

Or you can use PHPMailer instead of the mail() function: