0
php + check password duplicate in database

/t5/dreamweaver-discussions/php-check-password-duplicate-in-database/td-p/701717
Dec 18, 2006
Dec 18, 2006
Copy link to clipboard
Copied
Hi I know Dreamweaver allow you to check for duplicate
usernames but I would also like to be able to check for passwords.
I tried following the same as the username but it disregards it.
Any suggestions?
Thanks for your time.
I tried following the same as the username but it disregards it.
Any suggestions?
Thanks for your time.
TOPICS
Server side applications
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
LEGEND
,
LATEST
/t5/dreamweaver-discussions/php-check-password-duplicate-in-database/m-p/701718#M106378
Dec 18, 2006
Dec 18, 2006
Copy link to clipboard
Copied
jjjhbj111 wrote:
> Hi I know Dreamweaver allow you to check for duplicate usernames but I would
> also like to be able to check for passwords.
It's not really necessary because the combination of the username and
password will still be unique. However, if you want to do it, you simply
need to create a recordset that uses the password as a filter.
Dreamweaver recordsets automatically create a variable that contains the
number of rows in the recordset. It's in the final line of the recordset
code, and looks like this:
$totalRows_recordsetName = mysql_num_rows($recordsetName);
You can then wrap the insert record code in a conditional statement like
this:
if ($totalRows_recordsetName > 0) {
$duplicatePass = 'Please choose a different password';
}
else {
// insert record code goes here
}
In the main body of the form:
if (isset($duplicatePass)) echo $duplicatePass;
--
David Powers, Adobe Community Expert
Author, "Foundation PHP for Dreamweaver 8" (friends of ED)
Author, "PHP Solutions" (friends of ED)
http://foundationphp.com/
> Hi I know Dreamweaver allow you to check for duplicate usernames but I would
> also like to be able to check for passwords.
It's not really necessary because the combination of the username and
password will still be unique. However, if you want to do it, you simply
need to create a recordset that uses the password as a filter.
Dreamweaver recordsets automatically create a variable that contains the
number of rows in the recordset. It's in the final line of the recordset
code, and looks like this:
$totalRows_recordsetName = mysql_num_rows($recordsetName);
You can then wrap the insert record code in a conditional statement like
this:
if ($totalRows_recordsetName > 0) {
$duplicatePass = 'Please choose a different password';
}
else {
// insert record code goes here
}
In the main body of the form:
if (isset($duplicatePass)) echo $duplicatePass;
--
David Powers, Adobe Community Expert
Author, "Foundation PHP for Dreamweaver 8" (friends of ED)
Author, "PHP Solutions" (friends of ED)
http://foundationphp.com/
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more

