On Tue, 4 Sep 2001 12:06, Gary wrote:
> Hello Everybody,
> I have a script that checks if the password and password confirm are
> the same on a sign up page. It seems that if the password is already in
> the db it prints out passwords do not match like the password and
> confirm do not match. Why?
>
>
> //check if passwords match
>
> if ($password != $pass_check) {
> echo "<center><h3>Password's don't match!<br>Please use your back
> button and fix the error</h3></center>";
>
> } else {
>
> // Connect To The Database
>
> $db = mysql_connect("localhost","user","password") or die ("couldn't
> connect to server");
>
> mysql_select_db("dbname",$db) or die ("couldn't select database");
>
> //Find Out If They Are Already In The System
>
> $sql = "SELECT name,email FROM tablename WHERE
> name='$name' OR email='$email'";
> $result=mysql_query($sql);
> $num=mysql_numrows($result);
> if ($num > 0)
> echo "<center><h3>Your Username is already
> taken.<br>Please use your back button and choose
> another</h3></center>";
> else {
>
> more code
>
> TIA
> Gary
Is the password stored as an encrypted string in the DB (one would hope
so!) If so, you'll need to compare an encrypted version of the string you
are testing.
--
David Robley Techno-JoaT, Web Maintainer, Mail List Admin, etc
CENTRE FOR INJURY STUDIES Flinders University, SOUTH AUSTRALIA
"This tuna is excellent," said Tom superficially.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]