Hello, I work for a non-profit agency and I have been up all night trying to fix a registration form that has suddenly stopped working after a php upgrade from v 5.0 to v 5.2. The server admin says it is my coding. When you hit submit the form actually does what it is supposed to however the missing link here is that I am not being emailed after each registration with the registraiton informationl. You can see the form in action at www.nctt.net/coreTest.php I have also cut and pasted the contents of that file below and have attached it to this email. There is also the last version of the form I used still up on the website that I never took down after our summer program. There are a few modifications to this page to meet the program requirements but in July www.nctt.net/SIReg.php was working fine.
Any assitance, hints, suggestions, anything at all is welcome and I thnk you in advance for taking a loot. Jennifer
<!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=utf-8" />
<title>NCTT Registration Form</title>
<style type="text/css">
body { margin: 10px padding: 0; font-size: 100%; }
* { }
h1.register { text-align: center; padding: 18px; background: #cc0033; color: #ffffff; font: 160% Arial, Helvetica, sans-serif; font-weight: bold; text-transform: uppercase; }
h1.costs { margin: 10px 0 0 0; padding: 0; border-bottom: 5px solid #cccccc; font: 320% Arial, Helvetica, sans-serif; color: #0071b7; font-weight: bold; text-transform: uppercase; line-height: 1.5em; text-align: left; }
h1.title { margin: 10px 0 0 0; padding: 0; border-bottom: 5px solid #cccccc; font: 180% Arial, Arial, Helvetica, sans-serif; color:#0071b7; font-weight: bold; text-transform: uppercase; line-height: 1.5em; text-align: left; }
h1.regbox { color: #cc0033; font: 200% Trebuchet Ms, Arial; letter-spacing: -1px; margin: 0; padding: 0; text-align: center; }
h1.side { letter-spacing: -1px; text-align: center; font: 140% Arial, Helvetica, sans-serif; font-weight: bold; color: #ffffff; padding: 0; margin: 0; }
h2 { text-align: left; margin: 0; padding: 0; line-height: 1.8em; color: #cc0033; font-size: 170%; font-family: trebuchet ms; }
h2.regbox { color: #0071b7; font: 140% Trebuchet Ms, Arial; letter-spacing: -1px; font-weight: bold; margin: 5px 0 0 0; padding: 0; text-align: center; }
h2.enroll { color: #0071b7; font: 120% Trebuchet Ms, Arial; font-weight: bold; text-align: left; border-bottom: 3px solid #cccccc; margin: 15px 0 0 0;}
h3 { margin: 0; padding: 0; line-height: 1.8em; color: #cc0033; font-size: 110%; font-family: trebuchet ms; }
h4 { margin: 0; padding: 0; line-height: 1.8em; color: #cc0033; font-size: 90%; font-family: trebuchet ms; }
p.normal { text-align: left; font: 75% Arial, Helvetica, sans-serif; line-height: 1.4em; margin: 5px; padding: 0; color: #000000; }
.prices { border-bottom: 1px solid #ccc; color: #cc0033; line-height: 2em; font: 80% Arial, Helvetica, sans-serif; margin: 0; padding: 5px; }
p.special { text-align: left; padding: 10px; margin: 5px 0 5px 0; background-color: #efefef; border: 1px solid #0071b7; font: 80% Arial, Helvetica, sans-serif; line-height: 1.5em; }
p.normal1 { text-align: center; font: 75% Arial, Helvetica, sans-serif; line-height: 1.4em; margin: 5px; padding: 0; color: #000000; }
span.price { border-bottom: 1px solid #ccc; color: #0071b7; line-height: 2em; font: 80% Arial, Helvetica, sans-serif; margin: 0; padding: 5px; }
td.reg { background: #0071b7; border-bottom: 5px solid #0071b7; color: #ffffff; font-family: Arial, Helvetica, sans-serif; font-size: 150%; font-weight: bold; text-transform: uppercase; letter-spacing: -1px; }
td.reg-line { border-bottom: 5px solid #0071b7; }
td.title { font: 100% Arial, Helvetica, sans-serif; color: #000000; font-weight: bold; }
label { font: 100% trebuchet ms, arial; color: #0071b7; font-weight: bold; }
input { margin: 0; padding: 5px; }
input.sub { padding: 10px; font-family: arial; color: #000033; font-size: 12pt; font-weight: bold; background: #ccc; text-transform: uppercase; }
.success { color: #ffffff; background: #0071b7; font-weight: bold; font: 100% arial; border: 1px solid #000; padding: 10px; }
.error { color: #fff; background: #FF0000; padding: 10px; border: 1px solid #990000; font: 90% arial; }
a:link { text-align: left; font: 125% Arial, Helvetica, sans-serif; line-height: 1.4em; font-weight: bold; padding: 0; color: #cc3333; text-decoration: underline; }
a:active {text-align: left; font: 125% Arial, Helvetica, sans-serif; line-height: 1.4em; font-weight: bold; padding: 0; color: #ff9933; text-decoration: none; }
a:visited {text-align: left; font: 125% Arial, Helvetica, sans-serif; line-height: 1.4em; font-weight: bold; padding: 0; color: #009933; text-decoration: underline; }
a:hover {text-align: left; font: 125% Arial, Helvetica, sans-serif; line-height: 1.4em; font-weight: bold; padding: 0; color: #0099ff; text-decoration: none;}
p.check {text-align: left; font: 110% Arial, Helvetica, sans-serif; line-height: 1.4em; font-weight: bolder; padding: 0; color: #cc0033; }
</style>
</head>
<body>
<center>
<?
if($_POST['submit']) {
$first = $_POST['first_name'];
$last = $_POST['last_name'];
$middle = $_POST['middle_name'];
$dob = $_POST['dob'];
$module_1 = $_POST['module_1'];
/*$module_2 = $_POST['module_2'];*/
$province = $_POST['province'];
$address_1 = $_POST['address_1'];
$address_2 = $_POST['address_2'];
$city = $_POST['city'];
$state = $_POST['state'];
$zip = $_POST['zip'];
$school = $_POST['school'];
$country = $_POST['country'];
$taught = $_POST['taught'];
$grade = $_POST['grade'];
$home = $_POST['home'];
$work = $_POST['work'];
$email = $_POST['email'];
if(!empty($first) && !empty($last) && !empty($address_1) && !empty($city) && !empty($state) && !empty($zip) && !empty($home) && !empty($email)) {
if($module_1) {
$cost = $cost+195;
$add_email .= "<li>December 5, 2014: YES ($195)</li>";
}
/*
if($module_2) {
$cost = $cost+1075;
$add_email .= "<li>Week II: YES ($1075)</li>";
}
if(date("n") <= 15) {
$before = $cost*.05;
$before = round($before,2);
$cost = $cost-$before;
} */
$msg .= "<body style=\"font-family: arial; font-size: 10pt; line-height: 1.5em;\">";
$msg .= "<p>These are the registration details submitted from the website.</p>";
$msg .= "<ul>";
$msg .= $add_email;
$msg .= "<li><strong>Name:</strong> " . $first . " " . $middle . " " . $last . "</li>";
$msg .= "<li><strong>Address One:</strong> " . $address_1 . "</li>";
$msg .= "<li><strong>Address Two:</strong> " . $address_2 . "</li>";
$msg .= "<li><strong>City:</strong> " . $city . "</li>";
$msg .= "<li><strong>State:</strong> " . $state . "</li>";
$msg .= "<li><strong>Zipcode:</strong> " . $zip . "</li>";
$msg .= "<li><strong>Province:</strong> " . $province . "</li>";
$msg .= "<li><strong>Country:</strong> " . $country . "</li>";
$msg .= "<li><strong>School:</strong> " . $school . "</li>";
$msg .= "<li><strong>Grade Taught:</strong> " . $grade . "</li>";
$msg .= "<li><strong>Field/Subject Taught:</strong> " . $taught . "</li>";
$msg .= "<li><strong>Home Phone:</strong> " . $home . "</li>";
$msg .= "<li><strong>Work Phone:</strong> " . $work . "</li>";
$msg .= "<li><strong>Email:</strong> " . $email . "</li>";
$msg .= "</ul>";
$msg .= "<p>Total Cost: $" . $cost . "</p>";
/* if($before) {
$msg .= "<p>This was sent before April 15, 2013, so 5% has been taken off the total.</p>";
}*/
$msg .= "</body>";
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=UTF-8' . "\r\n";
$headers .= 'From:
[email protected]';
$to = "
[email protected]";
$subject = "Registration Form | " . $first . " " . $middle . " " . $last;
mail($to,$subject,$msg,$headers);
?>
<div class="success">
We have successfully sent your registration details to NCTT. Please click on "Add to Cart" below, and checkout with Paypal to complete your resgistration. <strong>Space will not be held for registration without payment unless you have contacted the office at 417-773-1654 and spoken to Jennifer to make special arrangements.</strong> <br />
<form target="paypal" action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_cart">
<input type="hidden" name="business" value="
[email protected]">
<input name="item_name" type="hidden" class="title" value="Registration: Critical Thinking, Reading, Writing and the Common Core ">
<input type="hidden" name="amount" value="<? echo $cost; ?>">
<input type="hidden" name="no_note" value="1">
<input type="hidden" name="currency_code" value="USD">
<input type="hidden" name="no_shipping" value="1" />
<input type="hidden" name="on0" value="name">
<input type="hidden" name="os0" maxlength="60" value="<? echo $first . " " . $middle . " " . $last; ?>">
<input type="image" src="https://www.paypal.com/en_US/i/btn/x-click-but22.gif" border="0" name="submit" alt="Make payments with PayPal - it's fast, free and secure!">
<input type="hidden" name="add" value="1">
</form><!--<form target="paypal" action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_cart">
<input type="hidden" name="business" value="
[email protected]">
<input type="image" src="https://www.paypal.com/en_US/i/btn/btn_viewcart_LG.gif" border="0" name="submit" alt="Make payments with PayPal - it's fast, free and secure!">
<input type="hidden" name="display" value="1">
</form>-->
</div>
<?
}
else {
echo "<div class=\"error\">Sorry, please fill out all of the required fields.</div>";
}
}
else {
?>
<form action="core.php" method="post">
<table border="0" cellpadding="5" cellspacing="0" width="80%">
<tr>
<td colspan=3><h1 class="costs"><div align="center">REGISTER ONLINE</div></h1></td>
</tr>
<tr>
<td width=10%></td>
<td width="90%" valign="top">
<table border=0 cellpadding=3 cellspacing=0 width="100%">
<tr>
<td class="prices" align="left"><a href="core.htm">Critical Thinking, Reading, Writing and the Common Core</a>
<br /><p>December 5, 2014</p></td>
<td width="30%" align="right" class="prices"><p style="font-weight:bold; color:#cc3300; font-size:14px;">$195.00</p></td>
</tr>
</table>
</td>
<td width=20%></td>
</tr>
</table>
<table border="0" cellpadding="5" cellspacing="0" width="80%">
<tr>
<td width="50%" align="center" class="reg">Registration</td>
</tr>
</table>
<table border="0" cellpadding="5" cellspacing="0" width="80%">
<tr>
<td width=17%></td>
<td width="66%" valign="top">
<div align="center"><h1 class="title">Critical Thinking, Reading, Writing and the Common Core</h1></div>
<p class="check">You <i>must check</i> the box below for your registration to be valid. Thank you.</p>
<input type="checkbox" name="module_1" value="1" /> <label for="module_1">Critical Thinking, Reading, Writing and the Common Core</label>
<!--<table border="0" cellpadding="3" cellspacing="1" width="100%">
<tr>
<td width="25%" valign="top">
<p style="font-weight:bold; font-size:14px; color:#cc3300;">December 6, 2013 $150.00</p>
</td>
<td width="25%"></td>
</tr>
<tr>
<td width="25%"><input type="checkbox" name="module_1" value="1" /> <label for="module_1">Critical Thinking, Reading, Writing and the Common Core</label></td>
<td></td>
</tr>
<tr>
<td width="25%" valign="top">
<h4>Week II ($1075.00)</h4>
</td>
<td width="25%"></td>
</tr>
<tr>
<td width="25%"><input type="checkbox" name="module_2" value="1" /> <label for="module_2">Summer Institute Week II</label></td>
<td></td>
</tr>
</table>-->
<hr size=1 width=100% noshade />
<table border="0" cellpadding="2" cellspacing="0" width="100%">
<tr>
<td width="33%" align="center"><input type="text" name="first_name" size="30" /></td>
<td width="33%" align="center"><input type="text" name="middle_name" size="30" /></td>
<td width="33%" align="center"><input type="text" name="last_name" size="30" /></td>
</tr>
<tr>
<td width="33%" align="center"><p class="normal1">First Name</p></td>
<td width="33%" align="center"><p class="normal1">Middle Initial</p></td>
<td width="33%" align="center"><p class="normal1">Last Name</p></td>
</tr>
</table>
<table border="0" cellpadding="5" cellspacing="0" width="100%">
<tr>
<td><p class="normal">Address 1</p></td>
<td colspan="3" align="left"><input type="text" name="address_1" size="94" /></td>
</tr>
<tr>
<td><p class="normal">Address 2</p></td>
<td colspan="3" align="left"><input type="text" name="address_2" size="94" /></td>
</tr>
<tr>
<td><p class="normal">City</p></td>
<td align="left"><input type="text" name="city" size="20" /></td>
<td><p class="normal">State</p></td>
<td align="left"><input type="text" name="state" size="20" /></td>
</tr>
<tr>
<td><p class="normal">Zip</p></td>
<td align="left"><input type="text" name="zip" size="20" /></td>
<td><p class="normal">Province</p></td>
<td><input type="text" name="province" size="20" /></td>
</tr>
<tr>
<td><p class="normal">School/College</p></td>
<td align="left"><input type="text" name="school" size="56" /></td>
<td><p class="normal">Country</p></td>
<td><input type="text" name="country" size="20" /></td>
</tr>
<tr>
<td><p class="normal">Field/Subject Taught</p></td>
<td align="left"><input type="text" name="taught" size="56" /></td>
<td><p class="normal">Grade</p></td>
<td><input type="text" name="grade" size="20" /></td>
</tr>
<tr>
<td><p class="normal">Telephone (H)</p></td>
<td align="left"><input type="text" name="home" size="20" /></td>
<td><p class="normal">(W)</p></td>
<td><input type="text" name="work" size="20" /></td>
</tr>
<tr>
<td><p class="normal">Email Address</p></td>
<td colspan="3"><input type="text" name="email" size="94" /></td>
</tr>
<tr>
<td colspan=4 align=center><input type="submit" name="submit" value="Submit Form" class="sub" /></td>
</tr>
</table>
<td width=17%></td>
</td>
</tr>
</table>
</form>
<?
}
?>
</center>
</body>
</html>
coreTest.php
SIReg.php