I wanted to add some radio buttons to a form for a website I'm working on, but I'm struggling on getting them to work correctly.
I'm building in an ASP form with a PHP external sheet; here is what is in my PHP script right now:
<?php
$EmailFrom = "domain@site.com";
$EmailTo = "webmaster@site.com";
$Subject = "Referral";
$Name = Trim(stripslashes($POST['Name']));
$Date = Trim(stripslashes($POST['Date']));
$Address = Trim(stripslashes($POST['Address']));
$City = Trim(stripslashes($POST['City']));
$State = Trim(stripslashes($POST['State']));
$Zip = Trim(stripslashes($POST['Zip']));
$Email = Trim(stripslashes($POST['Email']));
$Phone = Trim(stripslashes($POST['Phone']));
$validationOK=true;
if (Trim($Name)=="") $validationOK=false;
if (!$validationOK) {
print "<meta http-equiv=\"refresh\" content=\"0;URL=error.htm\">";
exit;
}
$Body = "";
$Body .= "Name: ";
$Body .= $Name;
$Body .= "\n";
$Body .= "Date: ";
$Body .= $Date;
$Body .= "\n";
$Body .= "Address: ";
$Body .= $Address;
$Body .= "\n";
$Body .= "City: ";
$Body .= $City;
$Body .= "\n";
$Body .= "State: ";
$Body .= $State;
$Body .= "\n";
$Body .= "Zip: ";
$Body .= $Zip;
$Body .= "\n";
$Body .= "Email: ";
$Body .= $Email;
$Body .= "\n";
$Body .= "Phone: ";
$Body .= $Phone;
$Body .= "\n";
$success = mail($EmailTo, $Subject, $Body, "From: <$EmailFrom>");
if ($success){
print "<meta http-equiv=\"refresh\" content=\"0;URL=sent.html\">";
}
else{
print "<meta http-equiv=\"refresh\" content=\"0;URL=error.htm\">";
}
?>
I've been trying, but still struggling, on how to get the radio button coding in there. I want to add three sets, all being a "yes" and "no" for the selections. Any help is REALLY appreciated.
Thanks. 🙂