Forum Moderators: coopster
<form id="CCregistration" name="CCregistration" method="post" action="sendRegistration.php">
<div align="left">
<table border="0" cellspacing="2">
<caption align="top">
Fall 2006 Schedule
</caption>
<tr>
<td>I will Attend </td>
<td>Location</td>
<td>Site</td>
<td>Date</td>
<td>Time</td>
</tr>
<tr>
<td><input name="CCfair[]" type="checkbox" id="checkbox_CC/NoNJ" value="CC_NorthernNJ" /></td>
<td>Northern NJ </td>
<td>NJ City University<br />
(Main Gym) <br />
Jersey City, NJ </td>
<td>Mon. Oct. 24, 2006 </td>
<td>9:30 a.m.-12:30 p.m.</td>
</tr>
<tr>
<td><input name="CCfair[]" type="checkbox" id="checkbox_CC/CentralNJ" value="CC_CentralNJ" /></td>
<td>Central NJ </td>
<td><p>Bishop Ahr HS<br />
(Main Gym)<br />
Edision, NJ
</p>
</td>
<td>Tues. Oct. 25, 2006 </td>
<td>9:30 a.m.-12:30 p.m.</td>
</tr>
<tr>
<td><input name="CCfair[]" type="checkbox" id="checkbox_CC/SoNJ" value="CC_SouthernNJ" /></td>
<td>Southern NJ </td>
<td><p>Salem Community College<br />
(Main Gym)<br />
Carneys Point, NJ </p>
</td>
<td> </td>
<td>9:30 a.m.-12:30 p.m.</td>
</tr>
<tr>
<td><input name="CCfair[]" type="checkbox" id="checkbox_CC/CapeAtlantic" value="CC_CapeAtlantic" /></td>
<td>CapeAtlantic</td>
<td><p>Mainland Regional HS<br />
(Main Gym)<br />
Linwood NJ
</p>
</td>
<td> </td>
<td>9:30 a.m.-12:30 p.m.</td>
</tr>
</table>
<p> </p>
<p>Institution Name:
<input name="InstitutionName" type="text" id="InstitutionName" />
<br />
Address:
<input name="Address" type="text" id="Address" />
<br />
City:
<input name="City" type="text" id="City" />
State:
<input name="State" type="text" id="State" size="2" maxlength="2" />
Zip Code:
<input name="Zip" type="text" id="Zip" size="5" maxlength="5" />
<br />
Registrant Name:
<input name="Registrant" type="text" id="Registrant" />
<br />
Title:
<input name="Title" type="text" id="Title" />
<br />
Telephone:
<input name="Telephone" type="text" id="Telephone" size="12" maxlength="12" />
Fax:
<input name="Fax" type="text" id="Fax" size="12" maxlength="12" />
<br />
Email:
<input name="Email" type="text" id="Email" />
<br />
<input type="submit" name="Submit" value="Send" />
<br />
</p>
</div>
</form>
______________________________________________________________________________________
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<title>Untitled Document</title>
</head>
<body>
<?php
echo "<p>Thank you,$_POST[Registrant],for your registration!</p><p>You will receive confirmation of your registration details in the mail.";
echo "<p>Your Institution's Name is: $_POST[InstitutionName]</p>";
$msg = "InstitutionName: $_POST[InstitutionName]\n";
$msg .= "Address: $_POST[Address]\n";
$msg .= "City: $_POST[City]\n";
$msg .= "State: $_POST[State]\n";
$msg .= "Zip: $_POST[Zip]\n";
$msg .= "Registrant : $_POST[Registrant]\n";
$msg .= "Title: $_POST[Title]\n";
$msg .= "Telephone: $_POST[Telephone]\n";
$msg .= "Fax: $_POST[Fax]\n";
$msg .= "Email: $_POST[Email]\n";
$msg .= "CCfair: $HTTP_POST_VARS[CCfair]\n";
$recipient = "whomitneedstogoto@wherethatoneis.com";
$subject = "form submission results";
$mailheaders = "from: $_POST[Registrant]\n";
$mailheaders = "Reply-to: $_POST[Email]\n";
mail($recipient, $subject, $msg, $mailheaders);
?>
</body>
</html>
Also, the way you setup your checkboxes (using the brackets) means that the variable will be returned as an array, in which you should have the values of the checkboxes that were checked. Your script has to be coherent with that. Or if you want only one single button to be checked, use radio buttons instead of checkboxes.
Try changing this one line:
$msg .= "CCfair: $HTTP_POST_VARS[CCfair]\n";
To something like this:
$fairs = [url=http://us2.php.net/implode]implode[/url](',',$_POST['CCfair']);
$msg .= 'CCfair: '.$fairs.'\n';
Best of luck!
I look forward to learning more about php & databases
I don't yet understand how the code that eelixdpuppy recommended achieved what it did
Check the documentation on implode by following the link in my previous post.
Good luck ;)