Mar 12th, 2010, 11:27 AM
Ben -
Thanks for your reply.
Here is the code for the suspect form that is for my classes sign up in it's entirety:
Also here is the link to access the working form.
http://www.wawg.cap.gov/Pages/wta_reg.html
I have made sure that I updated everything recently so I know it's not a version issue at least.
Thanks for your time and any input that you may have.
Zack
Thanks for your reply.
Here is the code for the suspect form that is for my classes sign up in it's entirety:
Code:
<?php
require_once("*path is correct**/global/api/api.php");
$fields = ft_api_init_form_page(5);
$already_exists = "";
$params = array(
"submit_button" => "Submit",
"form_data" => $_POST,
);
$errors = array();
if (isset($_POST['Submit']))
{
$rules = array();
$rules[] = "required,capid,CAPid is required.";
$rules[] = "required,fname,Please enter your first name.";
$rules[] = "required,lname,Please enter your last name.";
$rules[] = "required,email,Please enter your email address.";
$rules[] = "required,phone,Please enter your phone number.";
$rules[] = "valid_email,email,Please enter a valid email address.";
$rules[] = "required,unit,Please select your unit.";
$rules[] = "length>2,unit,Please select your unit.";
$rules[] = "required,age,Please select your age.";
$rules[] = "length>1,age,Please select your age.";
$rules[] = "required,Sat,Please select your Saturday class.";
$rules[] = "length>1,Sat,Please select your Saturday class.";
$errors = validate_fields($_POST, $rules);
if (empty($errors))
{
$params["next_page"] = "submission2.php";
$params["finalize"] = true;
$criteria = array("capid" => $_POST["capid"]);
if (!ft_api_check_submission_is_unique(5, $criteria, $files["form_tools_submission_id"]))
{
$already_exists = true;
$fields = array_merge($fields, $_POST);
}
else
{
ft_api_process_form($params);
$fields = array_merge($fields, $_SESSION["form_tools_form"]);
}
}
else
{
$fields = array_merge($fields, $_POST);
}
}
?>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>WTA registration form</title>
<style type="text/css">
<!--
body {background-color: #333344;}
body,td,th {color: #FFFFFF;
font-family: Verdana, Arial, Helvetica, sans-serif;
font-weight: bold;}
.style1 {font-size: 12px}
.style2 {color: #FF0000;
font-style: italic;}
.style4 {font-size: 14px}
.style5 {color: #00CC33}
.style6 {font-size: 12px; color: #CCFF00;}
-->
</style>
</head>
<body>
<?php
if (!empty($errors))
{
echo "<div class='error'>Please fix the following errors:\n<ul>";
foreach ($errors as $error)
echo "<li>$error</li>\n";
echo "</ul></div>";
}
if (!empty($already_exists))
{
echo "<div class='error'><font color=red><strong>You have already submitted a Registration.</font></strong>";
echo "</ul></div>";
}
?>
<?PHP
$class="";
$classes="";
$query2="";
mysql_connect("mysql8.********.com","*****","*****");
mysql_select_db("*******");
$query2 = "SELECT * FROM ft2_form_11 ORDER BY submission_date DESC LIMIT 1 ";
$class = mysql_query($query2);
while($classes = mysql_fetch_array($class)){
?>
<form action="<?php echo $_SERVER["PHP_SELF"]?>" method="post">
<table width="625" border="0" cellpadding="0" cellspacing="10">
<tr>
<th width="336" scope="col"><div align="right" class="style1">CAPid</div></th>
<th colspan="2" scope="col"><div align="left" class="style1">
<input name="capid" type="text" value="<?=htmlspecialchars(@$fields["capid"])?>">
</div></th>
<th width="41" scope="col"> </th>
<th width="281" scope="col"> </th>
</tr>
<tr>
<td><div align="right" class="style1">Unit:</div></td>
<td colspan="2"><div align="left" class="style1">
<select name="unit">
<option value="" selected>Select Unit</option>
<option value="WA-01-Wing HQ" <?php if (@$fields["unit"] == "WA-01-Wing HQ") echo "selected"; ?>>WA-01-Wing HQ</option>
<option value="WA-02-Green River"<?php if (@$fields["unit"] == "WA-02-Green River") echo "selected"; ?>>WA-02-Green River</option>
<option value="WA-03-Spokane"<?php if (@$fields["unit"] == "WA-03-Spokane") echo "selected"; ?>>WA-03-Spokane</option>
<option value="WA-04-Pangborn"<?php if (@$fields["unit"] == "WA-04-Pangborn") echo "selected"; ?>>WA-04-Pangborn</option>
<option value="WA-05-TwinW"<?php if (@$fields["unit"] == "WA-05-TwinW") echo "selected"; ?>>WA-05-TwinW</option>
<option value="WA-07-Mt Rainier"<?php if (@$fields["unit"] == "WA-07-Mt Rainier") echo "selected"; ?>>WA-07-Mt Rainier</option>
<option value="WA-11-Columbia Basin"<?php if (@$fields["unit"] == "WA-11-Columbia Basin") echo "selected"; ?>>WA-11-Columbia Basin</option>
<option value="WA-15-Bellingham"<?php if (@$fields["unit"] == "WA-15-Bellingham") echo "selected"; ?>>WA-15-Bellingham</option>
<option value="WA-18-Seattle"<?php if (@$fields["unit"] == "WA-18-Seattle") echo "selected"; ?>>WA-18-Seattle</option>
<option value="WA-19-South Sound"<?php if (@$fields["unit"] == "WA-19-South Sound") echo "selected"; ?>>WA-19-South Sound</option>
<option value="WA-21-Fairchild AFB"<?php if (@$fields["unit"] == "WA-21-Fairchild AFB") echo "selected"; ?>>WA-21-Fairchild AFB</option>
<option value="WA-39-McChord AFB"<?php if (@$fields["unit"] == "WA-39-McChord AFB") echo "selected"; ?>>WA-39-McChord AFB</option>
<option value="WA-44-Yakima"<?php if (@$fields["unit"] == "WA-44-Yakima") echo "selected"; ?>>WA-44-Yakima</option>
<option value="WA-46-Skagit"<?php if (@$fields["unit"] == "WA-46-Skagit") echo "selected"; ?>>WA-46-Skagit</option>
<option value="WA-49-Paine Field"<?php if (@$fields["unit"] == "WA-49-Paine Field") echo "selected"; ?>>WA-49-Paine Field</option>
<option value="WA-50-Overlake"<?php if (@$fields["unit"] == "WA-50-Overlake") echo "selected"; ?>>WA-50-Overlake</option>
<option value="WA-51-Peninsula"<?php if (@$fields["unit"] == "WA-51-Peninsula") echo "selected"; ?>>WA-51-Peninsula</option>
<option value="WA-68-Northshore"<?php if (@$fields["unit"] == "WA-68-Northshore") echo "selected"; ?>>WA-68-Northshore</option>
<option value="WA-69-Renton"<?php if (@$fields["unit"] == "WA-69-Renton") echo "selected"; ?>>WA-69-Renton</option>
<option value="WA-70-Mt St Helens"<?php if (@$fields["unit"] == "WA-70-Mt St Helens") echo "selected"; ?>>WA-70-Mt St Helens</option>
<option value="WA-80-Ft Vancouver"<?php if (@$fields["unit"] == "WA-80-Ft Vancouver") echo "selected"; ?>>WA-80-Ft Vancouver</option>
<option value="WA-82-Tri-Cities"<?php if (@$fields["unit"] == "WA-82-Tri-Cities") echo "selected"; ?>>WA-82-Tri-Cities</option>
<option value="WA-90-Blue Mt"<?php if (@$fields["unit"] == "WA-90-Blue Mt") echo "selected"; ?>>WA-90-Blue Mt</option>
<option value="WA-91-Port Angeles"<?php if (@$fields["unit"] == "WA-91-Port Angeles") echo "selected"; ?>>WA-91-Port Angeles</option>
<option value="WA-92-Inter-State"<?php if (@$fields["unit"] == "WA-92-Inter-State") echo "selected"; ?>>WA-92-Inter-State</option>
<option value="WA-93-Arlington"<?php if (@$fields["unit"] == "WA-93-Arlington") echo "selected"; ?>>WA-93-Arlington</option>
<option value="WA-100-Northern Desert"<?php if (@$fields["unit"] == "WA-100-Northern Desert") echo "selected"; ?>>WA-100-Northern Desert</option>
<option value="WA-110-Lewis County"<?php if (@$fields["unit"] == "WA-110-Lewis County") echo "selected"; ?>>WA-110-Lewis County</option>
<option value="Oregon Wing Unit"<?php if (@$fields["unit"] == "Oregon Wing Unit") echo "selected"; ?>>Oregon Wing Unit</option>
<option value="Idaho Wing Unit"<?php if (@$fields["unit"] == "Idaho Wing Unit") echo "selected"; ?>>Idaho Wing Unit</option>
<option value="Other"<?php if (@$fields["unit"] == "Other") echo "selected"; ?>>Other</option>
</select>
</div></td>
<td> </td>
<td> </td>
</tr>
<tr>
<td><div align="right" class="style1">First Name:</div></td>
<td colspan="2"><input name="fname" type="text" value="<?=htmlspecialchars(@$fields["fname"])?>"></td>
<td><div align="right" class="style1">Email:</div></td>
<td><input type="text" name="email" value="<?=htmlspecialchars(@$fields["email"])?>"></td>
</tr>
<tr>
<td><div align="right" class="style1">Last Name: </div></td>
<td colspan="2"><input name="lname" type="text" value="<?=htmlspecialchars(@$fields["lname"])?>"></td>
<td><div align="right" class="style1">Age:</div></td>
<td><select name="age">
<option value="-" selected>-</option>
<option value="12"<?php if (@$fields["age"] == "12") echo "selected"; ?>>12</option>
<option value="13"<?php if (@$fields["age"] == "13") echo "selected"; ?>>13</option>
<option value="14"<?php if (@$fields["age"] == "14") echo "selected"; ?>>14</option>
<option value="15"<?php if (@$fields["age"] == "15") echo "selected"; ?>>15</option>
<option value="16"<?php if (@$fields["age"] == "16") echo "selected"; ?>>16</option>
<option value="17"<?php if (@$fields["age"] == "17") echo "selected"; ?>>17</option>
<option value="18"<?php if (@$fields["age"] == "18") echo "selected"; ?>>18</option>
<option value="19"<?php if (@$fields["age"] == "19") echo "selected"; ?>>19</option>
<option value="20"<?php if (@$fields["age"] == "20") echo "selected"; ?>>20</option>
<option value="21&Over"<?php if (@$fields["age"] == "21&Over") echo "selected"; ?>> 21 & Over</option>
</select></td>
</tr>
<tr>
<td><div align="right" class="style1">Phone Number:</div></td>
<td colspan="2"><input name="phone" type="text" id="phone" value="<?=htmlspecialchars(@$fields["phone"])?>">
</br>
XXXXXXXXXX</td>
<td><div align="right" class="style1">Sex:</div></td>
<td><select name="sex">
<option value="-" <?php if (@$fields["sex"] == "-") echo "selected"; ?>>-</option>
<option value="M"<?php if (@$fields["sex"] == "M") echo "selected"; ?>>Male</option>
<option value="F"<?php if (@$fields["sex"] == "F") echo "selected"; ?>>Female</option>
</select></td>
</tr>
<tr>
<td><div align="right" class="style1">Training Class:</div></td>
<td colspan="4"><span class="style1">
<select name="Sat" id="Sat">
<option value="-" <?php if (@$fields["Sat"] == "") echo "selected"; ?>>Choose One</option>
<?
IF (strlen($classes["class1name"])>2){
echo '<option value="';
echo $classes["class1name"];
echo '">';
echo $classes["class1name"];
echo '</option>';
}
IF (strlen($classes["class2name"])>2){
echo '<option value="';
echo $classes["class2name"];
echo '">';
echo $classes["class2name"];
echo '</option>';
}
IF (strlen($classes["class3name"])>2){
echo '<option value="';
echo $classes["class3name"];
echo '">';
echo $classes["class3name"];
echo '</option>';
}
IF (strlen($classes["class4name"])>2){
echo '<option value="';
echo $classes["class4name"];
echo '">';
echo $classes["class4name"];
echo '</option>';
}
IF (strlen($classes["class5name"])>2){
echo '<option value="';
echo $classes["class5name"];
echo '">';
echo $classes["class5name"];
echo '</option>';
}
IF (strlen($classes["class6name"])>2){
echo '<option value="';
echo $classes["class6name"];
echo '">';
echo $classes["class6name"];
echo '</option>';
}
IF (strlen($classes["class7name"])>2){
echo '<option value="';
echo $classes["class7name"];
echo '">';
echo $classes["class7name"];
echo '</option>';
}
IF (strlen($classes["class8name"])>2){
echo '<option value="';
echo $classes["class8name"];
echo '">';
echo $classes["class8name"];
echo '</option>';
}
IF (strlen($classes["class9name"])>2){
echo '<option value="';
echo $classes["class9name"];
echo '">';
echo $classes["class9name"];
echo '</option>';
}
?>
<option value="Staff"<?php if (@$fields["Sat"] == "Staff") echo "selected"; ?>>Staff Only</option>
</select>
</span></td>
</tr>
<tr>
<td><div align="right" class="style1">Staff Position approved by WTA Commander:</div></td>
<td colspan="2"><input name="staff" type="text" id="staff" value="<?=htmlspecialchars(@$fields["staff"])?>"></td>
<td colspan="2"><span class="style1">[Only if applicable]</span></td>
</tr>
<tr>
<td colspan="5"><div align="center" class="style1">Meals and Lodging </div></td>
</tr>
<tr>
<td><span class="style1">Staying the Entire Weekend <span class="style2">ONLY</span> fill this IN </span></td>
<td colspan="2"><span class="style1">
<select name="fullw" id="fullw">
<option value="-" selected>
<?php if (@$fields["fullw"] == "-") echo "selected"; ?>
Choose</option>
<option value="1"<?php if (@$fields["fullw"] == "1") echo "selected"; ?>>Yes</option>
<option value="no"<?php if (@$fields["fullw"] == "no") echo "selected"; ?>>No</option>
</select>
</span></td>
<td><span class="style1">Cost</span></td>
<td><p class="style4 style5">Depends on Training Refer to training descriptions. </p></td>
</tr>
<tr>
<td colspan="5"><p class="style1">Saturday - Breakfast, Lunch, Dinner<br>
Sunday - Lunch<br>
</p></td>
</tr>
<tr>
<td colspan="5"><div align="center" class="style1">-OR-</div></td>
</tr>
<tr>
<td colspan="5" class="style6">If you are NOT STAYING the entire weekend at Camp Murray then please fill in this portion of the form. Select the meals that you will need and lodging for a nights stay. </td>
</tr>
<tr>
<td colspan="3"><div align="center" class="style1">Saturday</div></td>
<td> </td>
<td> </td>
</tr>
<tr>
<td><div align="right" class="style1">Breakfast</div></td>
<td width="127"><span class="style1">
<select name="satb" >
<option value="-" <?php if (@$fields["satb"] == "-") echo "selected"; ?>>-</option>
<option value="1"<?php if (@$fields["satb"] == "1") echo "selected"; ?>>$4</option>
<option value="no"<?php if (@$fields["satb"] == "no") echo "selected"; ?>>No</option>
</select>
</span></td>
<td width="119"><span class="style1">$4.00</span></td>
<td colspan="2"><div align="center" class="style1">Lodging</div></td>
</tr>
<tr>
<td><div align="right" class="style1">Lunch</div></td>
<td><span class="style1">
<select name="satl" id="satl">
<option value="-" <?php if (@$fields["satl"] == "-") echo "selected"; ?>>-</option>
<option value="1"<?php if (@$fields["satl"] == "1") echo "selected"; ?>>$4</option>
<option value="no"<?php if (@$fields["satl"] == "no") echo "selected"; ?>>No</option>
</select>
</span></td>
<td><span class="style1">$4.00</span></td>
<td><div align="center">
<select name="lodg" >
<option value="-" <?php if (@$fields["lodg"] == "-") echo "selected"; ?>>-</option>
<option value="1"<?php if (@$fields["lodg"] == "1") echo "selected"; ?>>$4</option>
<option value="no"<?php if (@$fields["lodg"] == "no") echo "selected"; ?>>No</option>
</select>
</div></td>
<td><span class="style1">$5.00 </span></td>
</tr>
<tr>
<td><div align="right" class="style1">Dinner</div></td>
<td><span class="style1">
<select name="satd" id="satd">
<option value="-" <?php if (@$fields["satd"] == "-") echo "selected"; ?>>-</option>
<option value="1"<?php if (@$fields["satd"] == "1") echo "selected"; ?>>$4</option>
<option value="no"<?php if (@$fields["satd"] == "no") echo "selected"; ?>>No</option>
</select>
</span></td>
<td><span class="style1">$4.00</span></td>
<td> </td>
<td> </td>
</tr>
<tr>
<td colspan="3"><div align="center" class="style1">Sunday</div></td>
<td> </td>
<td> </td>
</tr>
<tr>
<td><div align="right" class="style1">Breakfast</div></td>
<td><span class="style1">
<select name="sunb" >
<option value="-" <?php if (@$fields["sunb"] == "-") echo "selected"; ?>>-</option>
<option value="1"<?php if (@$fields["sunb"] == "1") echo "selected"; ?>>$4</option>
<option value="no"<?php if (@$fields["sunb"] == "no") echo "selected"; ?>>No</option>
</select>
</span></td>
<td><span class="style1">$4.00</span></td>
<td> </td>
<td> </td>
</tr>
<tr>
<td><div align="right" class="style1">Lunch</div></td>
<td><span class="style1">
<select name="sunl">
<option value="-" <?php if (@$fields["sunl"] == "-") echo "selected"; ?>>-</option>
<option value="1"<?php if (@$fields["sunl"] == "1") echo "selected"; ?>>$4</option>
<option value="no"<?php if (@$fields["sunl"] == "no") echo "selected"; ?>>No</option>
</select>
</span></td>
<td><span class="style1">$4.00</span></td>
<td> </td>
<td> </td>
</tr>
<tr>
<td colspan="5"><span class="style1">Notes: (food allergies, special needs, ect.) </span></td>
</tr>
<tr>
<td colspan="5"><span style="font-size: 12px">
<textarea name="note" cols="50" rows="6" id="note" value="<?=htmlspecialchars(@$fields["note"])?>" nowrap></textarea>
</span></td>
</tr>
<td colspan="5"><div align="center">
<?php
if (!empty($errors))
{
echo "<div class='error'>Please fix the following errors:\n<ul>";
foreach ($errors as $error)
echo "<li>$error</li>\n";
echo "</ul></div>";
}
if (!empty($already_exists))
{
echo "<div class='error'><font color=red><strong>You have already submitted a Registration.</font></strong>";
echo "</ul></div>";
}
?>
</div></td>
</tr><tr>
<td><?
{
echo "<input name='announce' type='hidden' value='";
echo $classes["anounce"];
echo "'>";
}
?>
</td>
<td><input name="Submit" type="Submit" value="Submit"></td>
<td> </td>
<td> </td>
<td> </td>
</tr>
</table>
<p> </p>
</form>
<?php
}
?>
</body>
</html>
Also here is the link to access the working form.
http://www.wawg.cap.gov/Pages/wta_reg.html
I have made sure that I updated everything recently so I know it's not a version issue at least.
Thanks for your time and any input that you may have.
Zack