Form Not Submitting Text... Can't Figure Out Why... PLEASE HELP ME!
I recently set up a form on my website for clients to fill out. It's at my new site, which you can check out at:
Turbocharge Your Website's Sales With Copy That is Guaranteed to Get Results!
Down near the end there is a form to fill out and submit. Here's the problem:
I tested it by filling out the fields and hitting the submit button. The email comes through fine, but although the fields are listed (name, email etc) the information that I filled in was not... meaning that it's broken somewhere.
I had a look at the code and it SEEMS okay to me, so I'm not sure why this is happening.
By the way, the code calls a script called "contact.php" which is found at:
Contact email error
In case it's easier, though, I've included it here:
<?php if ($_POST['name'] != "" && $_POST['email'] && $_POST['website'] && $_POST['miscellaneous'] ) { $subject="Request for Copywriting Quote"; $ip=$_SERVER["REMOTE_ADDR"]; $host = $ip; $mon=date(m); $day=date(j); $year=date(y); $hour=date(g); $min=date(i); $sec=date(s); $hour=$hour-2; if($hour<=0) { $hour+=12; } $ts = "$hour:$min:$sec on $day/$mon/$year"; $to="daniel@noriskcopy.com"; $body=" Name: = $name Email Address (PLEASE DOUBLE-CHECK) = $email Website (If You Have One): = $website Please Briefly Describe the Type of Project You Require (Sales Letter, Autoresponder Emails, etc) = $whatis Briefly Describe the Product or Service You Need Copy Written For: = $product Anything Else You Think I Need to Know? = $miscellaneous Host: $host Time: $ts"; $email = "From: Form <$to>"; mail($to, $subject, $body, $email); ?> <html> <head> <title>Email Sent</title> </head> <body bgcolor="#ffffff" text="#666666"> <p> </p> <center> <table border="1" cellpadding="3" cellspacing="0" width="400" bordercolor="#919191" bgcolor="#E6E6E6"> <tr> <td width="100%"> <p><center><b><font color="#000000">Email was successfully sent to: <?php echo $to ?></font></b></center> </td> </tr> </table> </body> </html> <?php } else { ?> <html> <head> <title>Contact email error</title> </head> <body bgcolor="#ffffff" text="#666666"> <p><center> <table border="1" cellpadding="3" cellspacing="0" width="400" bordercolor="#919191" bgcolor="#E6E6E6"> <tr> <td width="100%"> <center> <b>There was an error with processing the email.</b><br> <p> <font color="#FF0000">Errors where:</font><br> <?php If (!$_POST['name']) echo "Name: field is empty<br>"; If (!$_POST['email']) echo "Email Address (PLEASE DOUBLE-CHECK) field is empty<br>"; If (!$_POST['website']) echo "Website (If You Have One): field is empty<br>"; If (!$_POST['miscellaneous']) echo "Anything Else You Think I Need to Know? field is empty<br>"; ?> <p> Email message wasn't sent </td> </tr> </table> </body> </html> <?php } ?> |
Can anyone help me out here?
Kind regards,
-Dan
Find me on MyBlogGuest | Geek Business | Low Cost Auctions
Always looking for badass direct-response copywriters. PM me if we don't know each other and you're looking for work.