Re: password why?

From: Date: Tue, 04 Sep 2001 04:05:43 +0000
Subject: Re: password why?
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-65836@lists.php.net to get a copy of this message
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.

« previous php.general (#65836) next »