Simple Form
Posted: Wed Apr 14, 2010 3:56 pm
Hi all,
This is no doubt really easy, but i have a form and i am submitting it via a php script. all the fields get emailed to me apart from the radio buttons?!?!
Heres the php:
Heres the form:
Excuse all the tables, i didn't make the form, im just getting it to submit.
I know this is easy for some, but im very green at php programming,
Thanks in advance,
Grant
This is no doubt really easy, but i have a form and i am submitting it via a php script. all the fields get emailed to me apart from the radio buttons?!?!
Heres the php:
Code: Select all
<?php
$to = "my email address";
$subject = "Samples";
$name = $_REQUEST['name'] ;
$company = $_REQUEST['company'] ;
$address = $_REQUEST['address'] ;
$postcode = $_REQUEST['postcode'] ;
$telephone = $_REQUEST['telephone'];
$email = $_REQUEST['email'];
$recommended = $_REQUEST['recommended'];
$comments = $_REQUEST['comments'];
$poolsafe = $_REQUEST['poolsafe'] ;
$poolsafegel = $_REQUEST['poolsafegel'] ;
$pristine = $_REQUEST['pristine'] ;
$pristinegel = $_REQUEST['pristinegel'] ;
$meadowfresh = $_REQUEST['meadowfresh'] ;
$spiro = $_REQUEST['spiro'] ;
$powerclean = $_REQUEST['powerclean'] ;
$headers = "From: $email";
$body = "$product . Samples To be sent to: $name\n$address .\n\nSamples needed...\nPoolsafe: $poolsafe.\nPristine: $pristine.\nSpiro: $spiro.\nPowerclean: $powerclean.\n\n$name 's Phone Number: $telephone.\n\nCompany: $company.\n\nEnquiry:\n$message";
$sent = mail($to, $subject, $body, $headers) ;
if($sent)
{header( 'Location: samples.php?worked=1' ) ;}
else
{print "We encountered an error sending your enquiry"; }
?>
Code: Select all
<form action="form_submit.php" method="get" name="samples">
<table width="800" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="280">
<input name="name" type="text" class="input_box" value="Name" />
<input name="company" type="text" class="input_box" value="Company" />
<textarea name="address" class="input_box_multi">Address</textarea>
<input name="postcode" type="text" class="input_box" value="Post Code" />
<input name="telephone" type="text" class="input_box" value="Telephone" />
<input name="email" type="text" class="input_box" value="Email" />
<input name="recommended" type="text" class="input_box" value="Recommended By" />
<textarea name="comments" class="input_box_multi">Comments</textarea>
<input type="image" class="submit" src="images/place_order.jpg" alt="Submit Form" />
</td>
<td width="520" valign="top">
<table width="480" border="0" cellpadding="0" cellspacing="0" class="table_move" >
<tr>
<td height="1" colspan="2"><img src="images/spacer.gif" width="257" height="1" /></td>
</tr>
<tr>
<td width="120" align="left" valign="top">
<label>
<input type="radio" name="poolsafe" value="checkbox" id="Poolsafe" /><strong>Poolsafe</strong></label></td>
<td width="360" align="left" valign="top">Removes poolside scale, scum and body fats without effecting the pH balance and TDS levels of the pool water. A must for use in all wet areas including changing rooms and showers. Restores the original Anti-Slip properties of the tiles. For a deep clean use neat. Dilute up to 40:1 for general maintenance. POOLSAFE Gel is also available for difficult vertical surfaces, such as scum lines</td>
</tr>
<tr>
<td height="15" colspan="2"><img src="images/spacer.gif" width="420" height="15" /></td>
</tr>
<tr>
<td height="15"><label>
<input type="radio" name="poolsafegel" value="checkbox" id="Poolsafegel" /><strong>Poolsafe Gel</strong></label></td>
<td height="15">For difficult vertical surfaces, such as scum lines and shower walls etc</td>
</tr>
<tr>
<td height="15" colspan="2"><img src="images/spacer.gif" width="420" height="15" /></td>
</tr>
<tr>
<td height="15"><label>
<input type="radio" name="pristine" value="checkbox" id="Pristine" /><strong>Pristine</strong></label></td>
<td height="15">An easy to use descaling fluid, that works hand in hand with POOLSAFE. The perfect solution, for dissolving unsightly limescale and rust from most metals. Dilute up to 20:1. Pristine Gel is also available for veriticle surfaces.</td>
</tr>
<tr>
<td height="15" colspan="2"><img src="images/spacer.gif" width="420" height="15" /></td>
</tr>
<tr>
<td height="15"><label>
<input type="radio" name="pristinegel" value="checkbox" id="PristineGel" /><strong>Pristine Gel</strong></label></td>
<td height="15">Is designed to be used undiluted for difficult to clean and fixed objects.</td>
</tr>
<tr>
<td height="15" colspan="2"><img src="images/spacer.gif" width="420" height="15" /></td>
</tr>
<tr>
<td height="15"><label>
<input type="radio" name="meadowfresh" value="checkbox" id="Meadowfresh" /><strong>Meadow Fresh</strong></label></td>
<td height="15">A superior biocidal cleaner/sanitser that has a pleasing fragrance. Kills MRSA superbug, Pseudomonas aeruginosa, E-coli, Staphylococcus Hepatitis B and C and HIV. For use in all areas, dilute up to 100:1, for sanitising 40:1.</td>
</tr>
<tr>
<td height="15" colspan="2"><img src="images/spacer.gif" width="420" height="15" /></td>
</tr>
<tr>
<td height="15"><label>
<input type="radio" name="spiro" value="checkbox" id="Spiro" /><strong>Spiro</strong></label></td>
<td height="15">A specialised product that plays a vital role within your cleaning routines and completely destroys body odours in saunas, steam rooms and gyms. Can remove stains and odours from all areas. Dilute 1:1 with warm water.</td>
</tr>
<tr>
<td height="15" colspan="2"><img src="images/spacer.gif" width="420" height="15" /></td>
</tr>
<tr>
<td height="15"><label>
<input type="radio" name="powerclean" value="checkbox" id="PowerClean" /><strong>Power Clean</strong></label></td>
<td height="15">A supreme multi-purpose cleaning gel for daily use. Will eliminate and prevent build up of mould, mildew, algae and their spores. Ideal for showers, washrooms and toilets, rubber flooring, safer surfaces, patio's and any hard surface.</td>
</tr>
</table>
</table>
</form>
I know this is easy for some, but im very green at php programming,
Thanks in advance,
Grant