Add this into the VERY last line :

<?php } ?>

[...]
<?php # script 3.11 register.php
if (isset($_POST['submit'])) { // Handel the form
 // check for name
  if (strlen($_POST['name']) > 0) {
  $name = TRUE;
} else {
  $name = FALSE;
  echo '<p>you have forgot to enter your name</p>';
 }
 // check for email adress
if (strlen($_POST['email']) > 0) {
 $email = TRUE;
} else {
 $email = FALSE;
 echo '<p>you have forgot to enter your email adress</p>';
 }
// check for a usermame
if (strlen($_POST['usermame']) > 0) {
 $usermame = TRUE;
} else {
 $usermame = FALSE;
 echo '<p>you have forgot to enter your usermame</p>';
 }

//check for a password and match against the comfirmed password.

if (strlen($_POST['password1']) > 0) {
       if ($_POST['password1'] ==
      ($_POST['password2'] {
1.....         $password = TRUE;

    } else {
       $password = FALSE;
       echo '<p<Your password did not match the confirmed password!</p>'
       }
} else {
 $password = FALSE;
 echo '<p>You forgot to enter your password!</p>';
}
if ($name && $email && $username && $password)
{ // if everyting's okayOK.
 //Register the user.
 echo '<p>you are now register.</p>'
 } else { //Something is not TRUE.
 echo '<p>Please go back and try again.</p>'
} else {

?>

<form action="<?php echo
$_SERVER['PHP_SELF']; ?>" method="post">
<fieldset><legend>Enter your information in the form below</legend>
<p><b>Name:</b> <input type="text" name="name" size="20" maxlength="40"
/></p>
<p><b>Email:</b> <input type="text" name="name" size="40" maxlength="60"
/></p>
<p><b>User name:</b> <input type="text" name="usermame" size="20"
maxlength="40" /></p>
<p><b>Password:</b> <input type="password" name="password1" size="20"
maxlength="40" /></p>
<p><b>Confirm Password:</b> <input type="password" name="password2"
size="20" maxlength="40" /></p>
</fieldset>
<div align="center"> <input type="submit" name="submit" value="Submit
information" /></div>

</form>

[...]

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to