I am having a problem with something and cannot figure it out!
if you go to this page: http://www.sportsrant.com/school/request.php which is a simple form and do not enter any information, it returns a basic error message with a back button to fill in the missing information!
It works perfect in Firefox and in IE it throws the check to the bottom of the page and I have gone over and over the page and cannot figure out what is causing it to do this.
Can someone help me out!!
<div id="container">
<div id="header">
<h1>Little Saints & Scholars</h1>
<p><em>Wylie's Premeire Pre-School</em></p>
</div>
<div id="sidebar">
<h2>News & Events</h2>
<p><?php
include('./calendar/calendar.php');
$calendar = new WingedCalendar();
$calendar->show_calendar();
?>
</p>
</div>
<div id="content">
<?php
// Address error handing.
ini_set ('display_errors', 1);
error_reporting (E_ALL & ~E_NOTICE);
//setup the variables used in $_POST for top of form
$prefix = trim($_POST['prefix']);
$firstname = trim($_POST['first']);
$lastname = trim($_POST['lastname']);
$email = trim($_POST['email']);
$dphone = trim($_POST['dayphone']);
$hphone = trim($_POST['homephone']);
$p_contact = trim($_POST['p_contact']);
//setup the variables used in $_POST for the second part of the form
//seteup the last variable used in the form for the text area box
$ecomments = trim($_POST['additional']);
// Check if the form has been submitted.
if (isset($_POST['submit']))
{
$problem = FALSE; // No problems so far.
//check to see if fields are populated in the top of the form
if (empty ($firstname)) //check for first name
{
$problem = TRUE;
echo '<p>You forgot to enter your first name, Please hit the back button and fill in the missing information</p>';
echo "<input type=button value=\"Back\" onClick=\"history.go(-1)\">";
echo '</div><div id="footer">
Copyright ©
<script type="text/javascript">
<!--
current = new Date();
document.write(current.getFullYear());
// -->
</script>
<a href="#" class="FooterLinks">Little Saints & Scholars</a>. All rights reserved.<br />';
exit;
}
if (empty ($lastname)) //check for last name
{
$problem = TRUE;
echo '<p>You forgot to enter your last name, Please hit the back button and fill in the missing information</p>';
echo "<input type=button value=\"Back\" onClick=\"history.go(-1)\">";
echo '</div><div id="footer">
Copyright ©
<script type="text/javascript">
<!--
current = new Date();
document.write(current.getFullYear());
// -->
</script>
<a href="#" class="FooterLinks">Little Saints & Scholars</a>. All rights reserved.<br />';
exit;
}
if (empty($email))//check for email address
{
$problem = TRUE;
echo '<p>You forgot to enter your email address, Please hit the back button and fill in the missing information</p>';
echo "<input type=button value=\"Back\" onClick=\"history.go(-1)\">";
echo '</div><div id="footer">
Copyright ©
<script type="text/javascript">
<!--
current = new Date();
document.write(current.getFullYear());
// -->
</script>
<a href="#" class="FooterLinks">Little Saints & Scholars</a>. All rights reserved.<br />';
exit;
}
elseif (!valid_email($email))//Check validity of email
{
$problem = TRUE;
echo '<p>Your email address is not correctly formatted, please push the back button and correct the error</p>';
echo "<input type=button value=\"Back\" onClick=\"history.go(-1)\">";
echo '</div><div id="footer">
Copyright ©
<script type="text/javascript">
<!--
current = new Date();
document.write(current.getFullYear());
// -->
</script>
<a href="#" class="FooterLinks">Little Saints & Scholars</a>. All rights reserved.<br />';
exit;
}
if (empty($dphone)) //check for phone contact number
{
$problem = TRUE;
echo '<p>You forgot to enter your telephone number, please hit the back button and enter your phone number</p>';
echo "<input type=button value=\"Back\" onClick=\"history.go(-1)\">";
echo '</div><div id="footer">
Copyright ©
<script type="text/javascript">
<!--
current = new Date();
document.write(current.getFullYear());
// -->
</script>
<a href="#" class="FooterLinks">Little Saints & Scholars</a>. All rights reserved.<br />';
exit;
}
//check to see if the required information is being filled out in the second part of the form
if (!$problem)
{ // If there weren't any problems send the email!
//email form to admin
}
}
///////////////////////////////////////////////////////////
// Funtions //
// //
///////////////////////////////////////////////////////////
function valid_email($email)
{
$pattern = "^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$";
if (eregi($pattern, $email))
{
return true;
}
else
{
return false;
}
}
?>
<h2>Request School Information</h2>
<p>* Denotes Required Field</p>
<form action="<?=$_SERVER['PHP_SELF']?>" method="post">
<table width="100%">
<tr>
<td align="right" width="31%">Prefix:</td>
<td align="left"><select name="prefix" size="1">
<option value="---">
---
</option>
<option value="Mr.">
Mr.
</option>
<option value="Mrs.">
Mrs.
</option>
<option value="Ms.">
Ms.
</option>
<option value="Miss">
Miss
</option>
<option value="Dr.">
Dr.
</option>
</select></td>
</tr>
<tr>
<td align="right">* First Name: </td>
<td align="left"><input name="first" type="text" maxlength="50" align="right"></td>
</tr>
<tr>
<td align="right">* Last Name: </td>
<td align="left"><input name="lastname" type="text" maxlength="50"></td>
</tr>
<tr>
<td align="right">* Email Address: </td>
<td align="left"><input name="email" type="text" maxlength="50"></td>
</tr>
<tr>
<td align="right">* Daytime Phone Number: </td>
<td align="left"><input name="dayphone" type="text" maxlength="30"></td>
</tr>
<tr>
<td align="right">Home Phone Number: </td>
<td align="left"><input name="homephone" type="text" maxlength="30"></td>
</tr>
<tr>
<td align="right">Preferred Contact Method: </td>
<td><select name="p_contact" size="1">
<option value="---">
---
</option>
<option value="home">
Home Phone
</option>
<option value="Daytime Phone">
Daytime Phone
</option>
<option value="Email">
Email
</option>
</select></td>
</tr>
<tr>
<td width="31%" align="right" nowrap="nowrap"></td>
<td width="69%" class="largerText" nowrap>
<textarea name="additional" cols="20" rows="7">
</textarea></td>
</tr>
<tr>
<td align="center" colspan="2"><input type="submit" name="submit" value="Request Information"></td>
</tr>
</table>
</form>
</div>
<div id="footer">
Copyright ©
<script type="text/javascript">
<!--
current = new Date();
document.write(current.getFullYear());
// -->
</script>
<a href="#" class="FooterLinks">Little Saints & Scholars</a>. All rights reserved.<br />
</div>
</div>
</body>
</html>
TIA
Mike