On my register page people fill out their details. name password etc...they then lick review details where they can check that they have entered everything correctly.
I then hit a problem. Even tho all fields have been entered it still says " Required Details -
Please make sure you enter into all required fields before trying to submit. "
both codes are really long but ill post them anyway.
this is the page where people add their details
Code:
head>
<title>The New Zealand Blackcurrant Co-Op</title>
<link rel="stylesheet" type="text/css" href="default.css" />
<head>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1"/>
<meta name="description" content="description"/>
<meta name="keywords" content="keywords"/>
<meta name="author" content="author"/>
<link rel="stylesheet" type="text/css" href="default.css" media="screen"/>
<title>The New Zealand Blackcurrant Co-Op!</title>
</head>
<body>
<br><br>
<div class="container">
<div class="navigation">
<div class="title">
<h1><font color= #8B668B> <b>The New Zealand Blackcurrant Co-Op</b></h1>
<h2>- - - - - - - - -</h2>
</div>
<a href="contact.html">Contact Us</a>
<a href="member.html">Members</a>
<a href="health.html">Health Benefits</a>
<a href="products.html">Products</a>
<a href="index.html">Home</a>
<div class="clearer"><span></span></div>
<br><br>
<center><b><font size= 2><u>Purple</u> - The colour of good health from New Zealand Blackcurrants -
delicious Daily!</b></center></font>
</div>
<div class="holder_top"></div>
<div class="holder">
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
<head>
<title>Registration Form</title>
<link rel="stylesheet" type="text/css" href="global.css" />
<a name="top"></a>
</head>
<body>
<center>
<h1></h1>
</center>
<h3>Register</h3>
<p><big>*</big> Required Information</p>
<hr />
<p><b>1. Personal Details</b></p>
<p>Please enter your personal details in the spaces provided.</p>
<form action="review.php" method="post">
<table border="0" cellpadding="3">
<tr>
<td>Title:</td>
<td>First Name(s):</td>
<td>Surname:</td>
</tr>
<tr>
<td><select name="title">
<option value="Mr">Mr</option>
<option value="Ms">Ms</option>
<option value="Mrs">Mrs</option>
<option value="Miss">Miss</option>
<option value="Doctor">Doctor</option>
<option value="Professor">Professor</option>
</select><big>*</big></td>
<td><input type="text" name="fname" maxlength="60" />
<big>*</big></td>
<td><input type="text" name="sname" maxlength="60" />
<big>*</big></td>
</tr>
<tr>
<td>Address:</td>
<td>Address 2:</td>
</tr>
<tr>
<td><input type="text" name="address" maxlength="50" size="30" />
<big>*</big></td>
<td><input type="text" name="address2" maxlength="50" size="30" /></td>
</tr>
<tr>
<td>Country:</td>
<td>City:</td>
</tr>
<tr>
<td> <select name="town">
(select country - removed because its very long)
</select>
<big>*</big></td>
<td><input type="text" name="county" maxlength="30" size="30" />
<big>*</big></td>
</tr>
<tr>
<td>Post Code:</td>
</tr>
<tr>
<td><input type="text" name="pcode" maxlength="10" size="7" />
<big>*</big></td>
</tr>
<tr>
<td>Telephone Number:</td>
</tr>
<tr>
<td><input type="text" name="tel_num" maxlength="15" size="15" />
<big>*</big></td>
</tr>
<tr>
<td>Email:</td>
<td>Re-Enter Email:</td>
</tr>
<tr>
<td><input type="text" name="email" maxlength="50" size="30" />
<big>*</big></td>
<td><input type="text" name="email2" maxlength="50" size="30" />
<big>*</big></td>
</tr>
<tr>
<td>I Prefer Plain Text Email <input type="checkbox" name="email_type" value="1" /></td>
</tr>
</table>
<br />
<hr />
<p><b>2. User Details</b></p>
<p>Please enter the username and password you wish to use to access this site. Your username and
password must be unique and if your chosen details are already taken you will have to choose another.
The secret question and answer are used in case you forget your login details. Choose a question
which you will easily remember the answer to in case of an emergency.</p>
<table border="0" cellpadding="3">
<tr>
<td>Enter A Username:</td>
</tr>
<tr>
<td><input type="text" name="user_name" maxlength="10" />
<big>*</big></td>
</tr>
<tr>
<td>Enter A Password:</td>
<td>Confirm Your password:</td>
</tr>
<tr>
<td><input type="password" name="pword" maxlength="16" />
<big>*</big></td>
<td><input type="password" name="pword2" maxlength="16" />
<big>*</big></td>
</tr>
<tr>
<td>Choose Your Secret Question:</td>
</tr>
<tr>
<td><select name="secretq">
<option value="1">What is your mothers maiden name?</option>
<option value="2">What is the name of your favorite pet?</option>
<option value="3">What is your favorite colour?</option>
<option value="4">What town were you born in?</option>
<option value="5">What is your best friend called?</option>
</select><big>*</big></td>
</tr>
<tr>
<td>Type Your Secret Answer:</td>
</tr>
<tr>
<td><input type="password" name="secreta" maxlength="20" />
<big>*</big></td>
</tr>
</table>
<br />
<hr />
<p><b>3. Terms & Conditions</b></p>
<p>Please read the terms and conditions carefully before submitting.</p>
<table border="0" cellpadding="3">
<tr>
<td>I agree to the <a href="yourterm.htm">terms and conditions.</a></td>
<td><input type="checkbox" value="1" name="terms" />
<big>*</big></td>
</tr>
</table>
<p id="c"><b>Warning!</b> In order for you to register successfully your browser must have cookies
enabled.
<br />
<br />
<input type="submit" value="Review Your Details" />
</p>
</form>
<a href="#top">Top of Page</a><br><br>
<div class="footer">All Rrights Reserved © 2007 New Zealand BlackCurrant Co-Op</a>.
</div>
</body>
</html>
and this is the php code where it checks if anything is wrong.
Code:
<?php
$title = $_POST['title'];
$fname = $_POST['fname'];
$sname = $_POST['sname'];
$address = $_POST['address'];
$town = $_POST['town'];
$county = $_POST['county'];
$pcode = $_POST['pcode'];
$telnum = $_POST['tel_num'];
$username = $_POST['user_name'];
$secretQ = $_POST['secretq'];
$secretA = $_POST['secreta'];
$email = $_POST['email'];
$chkEmail = $_POST['email2'];
$type = $_POST['email_type'];
$pword = $_POST['pword'];
$chkPword = $_POST['pword2'];
$add2 = $_POST['address2'];
$terms = $_POST['terms'];
if($type == 0)
{
$typeF = ("You Will Be Sent HTML Emails");
}
else
if($type == 1)
{
$typeF = ("You Will Be Sent Plain Text Email");
}
if($secretQ == 1)
{
$secretQf = ("What is your mothers maiden name?");
}
else
if($secretQ == 2)
{
$secretQf = ("What is the name of your favourite pet?");
}
else
if($secretQ == 3)
{
$secretQf = ("What is your favourite colour?");
}
else
if($secretQ == 4)
{
$secretQf = ("What town were you born in?");
}
else
if($secretQ == 5)
{
$secretQf = ("What is your best friend called?");
}
if($terms == 0)
{
$termsF = ("You <b>have not</b> accepted the terms & conditions.");
}
else
if($terms == 1)
{
$termsF = ("You have accepted the terms & conditions.");
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1"/>
<meta name="description" content="description"/>
<meta name="keywords" content="keywords"/>
<meta name="author" content="author"/>
<link rel="stylesheet" type="text/css" href="default.css" media="screen"/>
<title>The New Zealand Blackcurrant Co-Op!</title>
</head>
<body>
<br><br>
<div class="container">
<div class="navigation">
<div class="title">
<h1><font color= #8B668B> <b>The New Zealand Blackcurrant Co-Op</b></h1>
<h2>- - - - - - - - -</h2>
</div>
<a href="contact.html">Contact Us</a>
<a href="member.html">Members</a>
<a href="health.html">Health Benefits</a>
<a href="products.html">Products</a>
<a href="index.html">Home</a>
<div class="clearer"><span></span></div>
<br><br>
<center><b><font size= 2><u>Purple</u> - The colour of good health from New Zealand Blackcurrants -
delicious Daily!</b></center></font>
</div>
<div class="holder_top"></div>
<div class="holder">
<h1>Review Your Details</h1>
</center>
<p>Please review your details to make sure they are correct before submitting. Also make sure your browser has cookies enabled before registering as otherwise your registration will fail. You may wish to print this page for your own records, but remember to always keep account details secure. Additionally we will email you your user details once the account has been setup.</p>
<hr />
<p><b>1. Personal Details</b></p>
<table border="0" cellspacing="3" cellpadding="3">
<tr>
<td><b>Title:</b></td>
<td><b>First Name(s):</b></td>
<td><b>Surname:</b></td>
</tr>
<tr>
<td><?php echo($title); ?></td>
<td><?php echo($fname); ?></td>
<td><?php echo($sname); ?></td>
</tr>
<tr>
<td><b>City:</b></td>
<td><b>Country:</b></td>
</tr>
<tr>
<td><?php echo($address); ?></td>
<td><?php echo $_POST["address2"]; ?></td>
</tr>
<tr>
<td><b>Post Code:</b></td>
</tr>
<tr>
<td><?php echo($pcode); ?></td>
</tr>
<tr>
<td><b>Telephone Number:</b></td>
</tr>
<tr>
<td><?php echo($telnum); ?></td>
</tr>
<tr>
<td><b>Email:</b></td>
<td><b>Re-Typed Email:</b></td>
</tr>
<tr>
<td><?php echo($email); ?></td>
<td><?php echo($chkEmail); ?></td>
</tr>
<tr>
<td><?php echo($typeF); ?></td>
</tr>
</table>
<br />
<hr />
<p><b>2. User Details</b></p>
<table border="0" cellspacing="3" cellpadding="3">
<tr>
<td><b>Your Username:</b></td>
</tr>
<tr>
<td><?php echo($username); ?></td>
</tr>
<tr>
<td><b>Your Password:</b></td>
</tr>
<tr>
<td><?php echo($pword); ?></td>
</tr>
<tr>
<td><b>Your Secret Question:</b></td>
</tr>
<tr>
<td><?php echo($secretQf); ?></td>
</tr>
<tr>
<td><b>Your Secret Answer:</b></td>
</tr>
<tr>
<td><?php echo($secretA); ?></td>
</tr>
</table>
<br />
<hr />
<p><b>3. Terms & Conditions</b></p>
<table border="0" cellspacing="3" cellpadding="3">
<tr>
<td><?php echo($termsF); ?></td>
</tr>
</table>
<form id="c" action="insert.php" method="post">
<input type="hidden" name="title" value="<?php echo($title); ?>" />
<input type="hidden" name="fname" value="<?php echo($fname); ?>" />
<input type="hidden" name="sname" value="<?php echo($sname); ?>" />
<input type="hidden" name="address" value="<?php echo($address); ?>" />
<input type="hidden" name="town" value="<?php echo($address2); ?>" />
<input type="hidden" name="county" value="<?php echo($county); ?>" />
<input type="hidden" name="pcode" value="<?php echo($pcode); ?>" />
<input type="hidden" name="tel_num" value="<?php echo($telnum); ?>" />
<input type="hidden" name="user_name" value="<?php echo($username); ?>" />
<input type="hidden" name="secretq" value="<?php echo($secretQ); ?>" />
<input type="hidden" name="secreta" value="<?php echo($secretA); ?>" />
<input type="hidden" name="email" value="<?php echo($email); ?>" />
<input type="hidden" name="email2" value="<?php echo($chkEmail); ?>" />
<input type="hidden" name="email_type" value="<?php echo($type); ?>" />
<input type="hidden" name="pword" value="<?php echo($pword); ?>" />
<input type="hidden" name="pword2" value="<?php echo($chkPword); ?>" />
<input type="hidden" name="address2" value="<?php echo($add2); ?>" />
<input type="hidden" name="terms" value="<?php echo($terms); ?>" />
<input type="submit" value="Submit Your Details" />
<br />
<br />
<input type="button" value="Go Back" onclick="goBack()" />
</form>
<a href="#top">Top of Page</a>
</body>
</html>
Any help is greatly appreciated.