Hi, I have created a simple form so visitors of my site can subscribe to my newsletter. The form contains a box for name, email, address, city/state, and zip. Below is the php script I'm using, but when I hit submit, I receive the error, "Please Fill Out All Fields." Anyone know how to fix my script to where it will work properly. Below is the php code.
php:
<?php
$email = $POST["email"];
$address = $POST["address"];
$citystate = $POST["citystate"];
$zip = $POST["zip"];
$headers = "From: " . $POST["email"];
$name = $POST["name"];
$subject = "Please Subscribe me to the DanaLittleton.com Newsletter"; // your webpage
$time = date("l d F Y @ H:i");
$to = "youthman@soleministries.org"; // your email
$message2 = "\nName: " . $name . "\nEmail: " . $email . "\nAddress: " . $address . "\nCity/State: " . $citystate . "\nZip: " . $zip ;
if ($email) {
if (mail($to, $message2)) {
print("Thank You for subscribing. Click back to Return to DanaLittleton.com");
}
else {
print("The server encountered an unexpected condition which prevented it from fulfilling the request.");
}
}
else {
print("Please fill out all fields.");
}
?>