Sorry for the late reply, but try the following:
Code:
<?php
// Simple Form Script
// Copyright (C) 2005 Eric Zhang
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// Please send bugs/questions to erkzh@yahoo.com.
//--------------------------Set these paramaters--------------------------
$subject = 'Booking Submission'; // Subject of email sent to you.
$emailadd = 'blah@blah blah.co.uk'; // Your email address. This is where the form information will be sent.
$url = 'http://www.urlinhere.co.uk'; // Where to redirect after form is processed.
$reqField = "RadioButtonName"; //the name of the field that is required.
// --------------------------Do not edit below this line--------------------------
$text = "Results from form:\n\n";
$space = ' ';
$line = '
';
foreach ($_POST as $key => $value)
{
if ($key == $reqField) {
if ($value == "") {
echo $reqField.' must be checked/selected!';
die;
}
}
$j = strlen($key);
if ($j >= 20)
{echo "Name of form element $key cannot be longer than 20 characters";die;}
$j = 20 - $j;
for ($i = 1; $i <= $j; $i++)
{$space .= ' ';}
$value = str_replace('\n', "$line", $value);
$conc = "{$key}:$space{$value}$line";
$text .= $conc;
$space = ' ';
}
mail($emailadd, $subject, $text, 'From: '.$emailadd.'');
echo '<META HTTP-EQUIV=Refresh CONTENT="0; URL='.$url.'">';
?>
Simply change the name in red to the readio button/checkbox that you want selected. Hope this helps.
Bookmarks