Jump to content


Password protecting a page

  • Please log in to reply
1 reply to this topic

#1 pluke100

  • New Members
  • Pip
  • Newbie
  • 1 posts

Posted 30 August 2006 - 04:16 PM

Need some help

Got a file called register.php and it prints a box where to type a password and the rest:

<div id="wrap">
<p>Enter the password given by the admin to continue: </p>
<form action="register2.php" method="post">
Password: <input name="pass1" type="password" />
<input type="submit" />

Now register2.php is: (it checks that the password enter is psb)


$pass1 = $_POST['pass1'];

if ($pass1 == "psb") {include("phpAuth_adduser.php");} else {

echo "Wrong Password";}


The phpAuth_adduser.php is a simple registration:

If the password is right it shows the right things etc....

But when i submit the registration it's printing Wrong Password each time. any ideas ?

#2 Corona4456

  • Members
  • PipPipPip
  • Advanced Member
  • 244 posts
  • LocationEl Paso, TX

Posted 30 August 2006 - 04:43 PM

I tested your code and it is working fine on my end.  I don't know what the problem could be.

I type in 'psb' as the password and it works just fine
What is the CoronaMatrix?

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users