quiet storm Posted July 22, 2008 Share Posted July 22, 2008 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. Quote Link to comment https://forums.phpfreaks.com/topic/116099-radio-buttons-php-coding-with-an-asp-form/ Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.