Form:: Getting Radio Btns to work

I have a form, and it works, all except the Radio buttons.

I’m new to PHP, and very happy that I’ve been able to get this far, however, after several hours, still can’t get the Radio buttons to appear in the email - I think that is has something to do with the way they are listed in the FEEDBACK.PHP file -
I’ve tried several tutorials, but no luck.

any help would be greatly APPRECIATED!!
:rainbowaf

FORM:

[code]
































FORM
* Denotes a required field
Full Name: *

Email: *



Street: *

City: * 

Province/State: *

Postal/Zip: *

Home Phone: * 



Business Phone: *














 
 




































Are you between 18 and 65 years of age?



Yes

No
Position applied for:

Full-time


Yes

No
Part-time


Yes

No
Requested hourly wage:

Drivers Licence Class:
(if applicable)


Have you had any driving offences in the last 2 years?


Yes

No
Do you, or have you had a criminal record?


Yes

No

















Additional Information
 
Please list any additional information such as special skills or anything else that pertains to your application that is not listed above:





[/code]

FEEDBACK.PHP

[code]<?
// ------------- CONFIGURABLE SECTION ------------------------

// $mailto - set to the email address you want the form
// sent to, eg
//$mailto = "[email protected]" ;

$mailto = ‘[email protected]’ ;

// $subject - set to the Subject line of the email, eg
//$subject = “Feedback Form” ;

$subject = “Email subject” ;

// the pages to be displayed, eg
//$formurl = “http://www.example.com/feedback.html” ;
//$errorurl = “http://www.example.com/error.html” ;
//$thankyouurl = “http://www.example.com/thankyou.html” ;

$formurl = “employment.php” ;
$errorurl = “error.html” ;
$thankyouurl = “thankyou.html” ;

$uself = 1;

// -------------------- END OF CONFIGURABLE SECTION ---------------

$headersep = (!isset( $uself ) || ($uself == 0)) ? “rn” : “n” ;
$name = $_POST[‘name’] ;
$email = $_POST[‘email’] ;
$phoneH = $_POST[‘phoneH’] ;
$phoneW = $_POST[‘phoneW’] ;
$address = $_POST[‘address’] ;
$city = $_POST[‘city’] ;
$province = $_POST[‘province’] ;

$ageyes = $_POST[‘ageyes’] ;
$ageno = $_POST[‘ageno’] ;
$position = $_POST[‘position’] ;
$fulltimeY = $_POST[‘fulltimeY’] ;
$fulltimeN = $_POST[‘fulltimeN’] ;
$parttimeY = $_POST[‘parttimeY’] ;
$parttimeN = $_POST[‘parttimeN’] ;
$hourly = $_POST[‘hourly’] ;
$driverslice = $_POST[‘driverslice’] ;
$drivoffY = $_POST[‘drivoffY’] ;
$drivoffN= $_POST[‘drivoffN’] ;
$crimrecY = $_POST[‘crimrecY’] ;
$crimrecN = $_POST[‘crimrecN’] ;

$comments = $_POST[‘comments’] ;
$http_referrer = getenv( “HTTP_REFERER” );

if (!isset($_POST[‘email’])) {
header( “Location: $formurl” );
exit ;
}
if (empty($name) || empty($email) || empty($comments)) {
header( “Location: $errorurl” );
exit ;
}
if ( ereg( “[rn]”, $name ) || ereg( “[rn]”, $email ) ) {
header( “Location: $errorurl” );
exit ;
}

if (get_magic_quotes_gpc()) {
$comments = stripslashes( $comments );
}

$messageproper =

"This message was sent from:n" .
"$http_referrern" .
"------------------------------------------------------------n" .
"Name of sender: $namen" .
"Email of sender: $emailn" .
"Home phone of sender: $phoneHn" .
"Work phone of sender: $phoneWn" .
"Address of sender: $addressn" .
"City of sender: $cityn" .
"Province of sender: $provincen" .

"------------------------------------------------------------n" .

"Age Over: $ageyesn".
"Age Under: $agenon".
"Fulltime: $fulltimeYn" .
"Fulltime: $fulltimeNn" .
"Partime: $parttimeYn" .
"Partime: $parttimeNn" .
"Position: $positionn" .
"Hourly: $hourlyn" .
"Drivers Lic: $driverslicen" .
"Driving Offences: $drivoffYn" .
"Driving Offences: $drivoffNn" .
"Criminal Record: $crimrecYn" .
"Criminal Record: $crimrecNn" .


"------------------------- COMMENTS -------------------------nn" .
$comments .
"nn------------------------------------------------------------n" ;

mail($mailto, $subject, $messageproper,
“From: “$name” <$email>” . $headersep . “Reply-To: “$name” <$email>” . $headersep . “X-Mailer: chfeedback.php 2.07” );
header( “Location: $thankyouurl” );
exit ;

?>

[/code]

I’m guessing s/t needs to be done to this area:
$fulltimeY = $_POST[‘fulltimeY’] ;

But i’m not sure what and how

  1. two radio buttons belonging together have to have the same name
  2. please use the -tag as it has to be

<input name="fulltime" type="radio" id="fulltimeY" value="yes" /><label for="fulltimeY"> Yes</label> <input name="fulltime" type="radio" id="fulltimeN" value="no" /><label for="fulltimeN"> No</label>

and then u need to adjust ur php code:
[php]$fulltime = $_POST[‘fulltime’] ;[/php]
[php] “Fulltime: $fulltimen” .[/php]

:D

Thank you!!!

It worked perfectly.

Sponsor our Newsletter | Privacy Policy | Terms of Service