I have a form and what I want to do is that I want to make sure that the person checks the checkbox for the form to submit. if the user doesnt check the checkbox I want it to say, " You must check the checkbox to continue".
The form code is about in the middle of this script!!
<?php include ('login/includes/form_process.php'); ?>
<!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>Login/Register</title>
<link href="file:styly.css" rel="stylesheet" type="text/css" />
</head>
<body>
<!-- Begin Wrapper -->
<div id="wrapper">
<!-- Begin Header -->
<div id="header">
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p>Welcome To The Login Page</p>
</div>
<!-- End Header -->
<!-- Begin Left Column -->
<div id="leftcolumn">
<form action="" method="post">
<fieldset>
<p align="left">
<?php
// Display login or logout link on any page based on login status
if (isset($_SESSION['user_id'])) {
echo '<a href="login/logout.php" title="Logout">Logout</a><br />';
} else { // Not logged in.
echo '<a href="login/login.php" title="Login">Login</a><br />';
}
?>
</p>
<p align="left">
<?php
if (isset($_POST['submitted'])) {
// Validate the email address:
if (empty($_POST['email'])) {
echo '<p align="left" class="error"><font color="red">Enter Your Email!</font></p>';
}
}
?>
</p>
<p align="left"> <b>Email Address:</b>
<input type="text" name="email" size="20" maxlength="40" />
</p>
<p align="left">
<?php
if (isset($_POST['submitted'])) {
// Validate the password:
if (empty($_POST['pass'])) {
echo '<p align="left"class="error"><font color="red">Enter Your Password!</font></p>';
}
} // End of VALIDATING.
?>
</p>
<p align="left"><b>Password: </b>
<input type="password" name="pass" size="20" maxlength="20" />
</p>
<div align="left">
<p>
<input type="submit" name="submit" value="Login" />
</p>
<p>
<input type="hidden" name="submitted" value="TRUE" />
</p>
</div>
</fieldset>
</form>
<?php
// Display links based upon the login status - (if user is logged in):
if (isset($_SESSION['user_id'])) {
echo '<a href="login/logout.php" title="Logout">Logout</a><br />
<a href="login/change_password.php" title="Change Your Password">Change Password</a><br />
// If user is logged in, then it redirects them to the members page//
<meta HTTP-EQUIV="REFRESH" content="0; url=http://www.mywebsite.com/sample_page2.php">
';
// Add links if the user is an administrator:
if ($_SESSION['user_level'] == 1) {
echo '<br /><h4>Administrator</h4>';
echo '<a href="login/view_users.php" title="View Users">View Users</a><br />
<a href="login/view_users.php" title="View Users">View Users</a><br />
';
}
} else { // Display links if user is NOT LOGGED IN.
echo '<a href="login/register.php" title="Register for the Site">Register</a><br />
<a href="login/login.php" title="Login">Login</a><br />
<a href="login/forgot_password.php" title="Password Retrieval">Retrieve Password</a><br />
';
}
?>
</div>
<!-- End Left Column -->
<!-- Begin Right Column -->
<div id="rightcolumn">
<div align="left"></div>
</div>
<!-- End Right Column -->
<!-- Begin Footer -->
<div id="footer">END OF PAGE</div>
<!-- End Footer -->
</div>
<!-- End Wrapper -->
</body>
</html>
<?php // Flush the buffered output.
ob_end_flush();
?>