Jump to content

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 = "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. :)

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.