Re: Administrator page and password problem
| From: | Erik Gjertsen | Date: | Wed, 07 Apr 2004 22:37:33 +0000 |
| Subject: | Re: Administrator page and password problem | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-182736@lists.php.net to get a copy of this message | ||
Thanks for help Red.
Cut and past is not always work
But I got a new problem in the last line.
I don't understand watt the problem is here
Thanks Erik Gjertsen
"Erik Gjertsen" <erik@gjertsen.as> wrote in message
news:20040407210918.88583.qmail@pb1.pair.com...
> I try to made a administrator page that I need to writ user name and
> password. But I have problem with the password. There comes one error
where
> I writ 1..(one)
> I have not made a table on MySql but in the book I read it scowl work.
> Can some one tell me why it not work.
> Here is the code:
>
> <?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>
>
> Thanks fore any help
>
> Erik Gjertsen