Jump to content

Radio Buttons, PHP coding with an ASP form


Recommended Posts

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 = "[email protected]";

$EmailTo = "[email protected]";

$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. :)

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.