Turns out I was all screwed up. Here's the new code:
Inserted into head:
Code:
<?PHP
$selected_radio = $_POST['session'];
print $selected_radio;
?>
form:
Code:
<form action="home_contact.php" method="post" id="frmcontactform" >
<div>
<p>*Asterisk denotes mandatory field</p>
<fieldset>
<div><label for="college">*College</label>
<input type="text" name="college" id="college" size="41" />
</div>
</fieldset>
<br />
<fieldset>
<div><label for="streetaddress">*Street Address</label>
<input type="text" name="streetaddress" id="streetaddress" size="35" />
</div>
</fieldset>
<br />
<fieldset>
<div><label for="city">*City</label>
<input type="text" name="city" id="city" size="27" />
</div>
</fieldset>
<br />
<fieldset>
<div style="padding-bottom:12px"><label for="state">*State</label>
<input type="text" name="state" id="state" size="2" />
</div>
<div><label for="zip">*Zip</label>
<input type="text" name="zip" id="zip" size="5" />
</div>
</fieldset>
<br />
<fieldset>
<div><label for="contactperson">*Contact Person</label>
<input type="text" name="contactperson" id="contactperson" size="22" />
</div>
</fieldset>
<br />
<fieldset>
<div><label for="contactemail">*Contact Email</label>
<input type="text" name="contactemail" id="contactemail" size="23" />
</div>
</fieldset>
<br />
<fieldset>
<div><label for="phone">*Phone</label>
<input type="text" name="phone" id="phone" size="10" />
</div>
</fieldset>
<br />
<fieldset>
<div>
<label for="fax">Fax</label>
<input type="text" name="fax" id="fax" size="11" />
</div>
</fieldset>
<br />
<fieldset>
<div>
Please select the GISS session you plan to attend<P>
<input type="radio" name="session" id="giss1" value="GISS I"><?php print$giss1_status;?>
GISS I
<br />
<input type="radio" name="session" id="giss2" value="GISS II"><?php print$giss2_status;?> GISS II<br />
</div>
</fieldset>
<div class="centerac"><input type="submit" name="submit" id="submit" value="Submit to Enter Attendee Information" />
</div>
<br />
</div>
</form>
PHP
Code:
<?php
{
if(($_POST['college']=="")||($_POST['streetaddress']=="")||($_POST['city']=="")||($_POST['zip']=="")||($_POST['state']=="")||($_POST['contactperson']=="")||($_POST['contactemail']=="")||($_POST['phone']=="")||($_POST['fax']=="")||($_POST['giss1']=="")||($_POST['giss2']==""))
{
echo "<html><body><p>The following fields are <strong>required</strong>.</p><ul>";
if($_POST['college'] == ""){ echo "<li>*College</li>"; }
if($_POST['streetaddress'] == ""){ echo "<li>*Street Address</li>"; }
if($_POST['city'] == ""){ echo "<li>*City</li>"; }
if($_POST['zip'] == ""){ echo "<li>*Zip</li>"; }
if($_POST['state'] == ""){ echo "<li>*State</li>"; }
if($_POST['contactperson'] == ""){ echo "<li>*Contact Person</li>"; }
if($_POST['contactemail'] == ""){ echo "<li>*Contact Email</li>"; }
if($_POST['phone'] == ""){ echo "<li>*Phone</li>"; }
if($_POST['session'] == "unchecked") { echo "<li>You must select a GISS session</li>"; }
echo "</ul><p>Please use your browsers <a href=\"javascript:history.back();\">Back</a> button and fill out these fields.</p></body></html>";
}
if ($selected_radio == 'giss1') {
$giss1_status = 'checked';
}
else if ($selected_radio == 'giss2') {
$giss2_status = 'checked';
}
if(isset($_POST['submit'])) {
$to = "my@email.com";
$subject = "Contact Has Registered";
$college = $_POST['college'];
$streetaddress = $_POST['streetaddress'];
$city = $_POST['city'];
$state = $_POST['state'];
$zip = $_POST['zip'];
$contactperson = $_POST['contactperson'];
$contactemail = $_POST['contactemail'];
$phone = $_POST['phone'];
$selected_radio = $_POST['session'];
print $session;
}
$body = "From:$college
Street Address:$streetaddress
City:$city
State:$state
Zip Code:$zip
E-Mail:$contactemail
Phone Number:$phone
Contact Email:$contactemail
GISS Session:$selected_radio";
mail($to, $subject, $body);
$sendto = $_POST['contactemail'];
$ccto = "my@email.com";
$subject = "Registration";
$message = "Thank you for registering.
You are registered for:$selected_radio
College:$college
Address:$streetaddress
City:$city
State:$state
Zip:$zip
Contact Person:$contactperson
Contact Email:$contactemail";
if(mail($sendto, $subject, $message, $header)) header("location: attendee.html");
}
?>
<script type=text/javascript>
setTimeout("location.href='index.html'", [3000]);
</script>
Thanks, everyone for your help!
Bookmarks