Ask a Question related to Dreamweaver AppDev, Design and Development.
-
magda muskala #1
password checker
hi,
I have a little problem with the following part of my code.
I use post method to get the password from the form [$first ].
Because there is an encrypted password in mysql database, I check with
$pass = mysql_query("Select password('$unencryptedPass')");
while($row = mysql_fetch_array($unencryptedPass))
{
$encryptedPassw = $row[0];
}
how the encrypted password looks like.
Then I make a simple query:
mysql_query("Select login, password from edv_verantwortliche where
login = '$login' AND password = '$encryptedPassw'") or
die("authorization failed");
But it doesn' t seem to work. I could login every time.
I have checked all values with echo method - they are correct...
Could somebody help me, please.
TIA
magda muskala Guest
-
Grammar Checker
Is there a grammar checker extension for dreamweaver? -
Accessibility Checker
What is the purpose of the Accessibility Checker? Is it a definitive assessment of a document's accessibility? Do you advise people to use it as a... -
MySQL PHP Password Checker
Can anyone please lend me a hand, I'm trying to design a cookie based password system. I have managed to do everything bar one thing that is... -
os checker
Does anyone know of good code to check what browser and os people have, basically i need to load in one css file if people are on pc and another if... -
Tom Thackrey #2
Re: password checker
On 5-Oct-2003, [email]euv01657@student.euv-frankfurt-o.de[/email] (magda muskala) wrote:
You will only die if mysql encounters an error. Not finding any rows is not> hi,
> I have a little problem with the following part of my code.
> I use post method to get the password from the form [$first ].
> Because there is an encrypted password in mysql database, I check with
> $pass = mysql_query("Select password('$unencryptedPass')");
> while($row = mysql_fetch_array($unencryptedPass))
> {
>
> $encryptedPassw = $row[0];
> }
> how the encrypted password looks like.
> Then I make a simple query:
> mysql_query("Select login, password from edv_verantwortliche where
> login = '$login' AND password = '$encryptedPassw'") or
> die("authorization failed");
> But it doesn' t seem to work. I could login every time.
>
> I have checked all values with echo method - they are correct...
> Could somebody help me, please.
an error. Also, you can do it all in one SELECT.
try:
$rs = mysql_query("select login,password from edv_verantwortliche where
login=$login and password=password('$unencryptedPass')") or die('mysql
error: ',mysql_error());
if (mysql_numrows($rs)==0)
{
echo 'Authorization Failed.';
exit();
}
// authorization OK
}
--
Tom Thackrey
[url]www.creative-light.com[/url]
tom (at) creative (dash) light (dot) com
do NOT send email to [email]jamesbutler@willglen.net[/email] (it's reserved for spammers)
Tom Thackrey Guest
-
Eric8000 #3
Password Checker
Let me start by saying I am not an avid coder. I know Dreamweaver inside and
out and have used a lot of it's built in Database connectivity tools and always
get a lot of use from extensions. I am in search for and extension or add-on
which will check a user ID and Password. If the login is 'X' then you are
directed to a certain page. If the login is 'Y' you are directed elsewhere.
And so on, using an access database. I need to create about 3 or 4 different
groups. Any help is appreciated. Thanks
Eric8000 Guest
-
Eric8000 #4
Password Checker
Let me start by saying I am not an avid coder. I know Dreamweaver inside and
out and have used a lot of it's built in Database connectivity tools and always
get a lot of use from extensions. I am in search for and extension or add-on
which will check a user ID and Password. If the login is 'X' then you are
directed to a certain page. If the login is 'Y' you are directed elsewhere.
And so on, using an access database. I need to create about 3 or 4 different
groups. Any help is appreciated. Thanks
Eric8000 Guest
-
Manuel Socarras #5
Re: Password Checker
you don't need an extension for that, just add some vars and if's or
switch staments in the DW login behavior. specify your server model and
surely somebody will be able to help you
manuel
Eric8000 wrote:> Let me start by saying I am not an avid coder. I know Dreamweaver inside and
> out and have used a lot of it's built in Database connectivity tools and always
> get a lot of use from extensions. I am in search for and extension or add-on
> which will check a user ID and Password. If the login is 'X' then you are
> directed to a certain page. If the login is 'Y' you are directed elsewhere.
> And so on, using an access database. I need to create about 3 or 4 different
> groups. Any help is appreciated. Thanks
>Manuel Socarras Guest
-
Singularity.co.uk #6
Re: Password Checker
Have you tried the Dreamweaver Server Behaviors for User Authentication?
Brendan
Singularity.co.uk Guest
-
Billium99 #7
Re: Password Checker
Hello. The behavior you are looking for is included in the server behavior set
that DW provides by default. Once you set up a basic form for the username and
password to be typed, go into the Server Behaviors panel and click the plus (+)
sign. One of the listings there will be User Authentication and will give you
several options that should get you started. I wasn't much of a coder either,
but something that helped me make that leap was a book by the people at
Webassist.com. Their Web Application Recipes book has some terrific
tutorial/recipe chapters that take you through a half-plugin/half-coding
workflow. User login is one of their recipes, but they also take you through
building all of the other pages that might be handy once you have users logging
in; namely user management, edit user data, lost my password, and even user
access level, so that you could have more than one authentication tier for the
content on your sites. Good stuff! HTH Bill
Billium99 Guest
-
RichMcCrea #8
Re: Password Checker
you might decide that you don't want to base the names of the pages your user
groups are sent to IN YOUR CODE.. You may want to make that a field in your
user group table. then if you change where different user groups go, you don't
have to modify your code.. just change the links in your database (the links
would probably relative to the site root )... values for the startpagename
field in usergroups might include .\admin\mainmenu.asp .\normal\mainmenu.asp
..\managers\mainmenu.asp then just check the group that user should go to...
select nvl('.\login\loginpage.asp', usergroup.startpagename) as theirfirstpage
from usergroups full join users on usergroup.id=users.usergroup_id where
username=myLoginUser and userpassword=myPassword and redirect them to the page
having the name of the sql field theirfirstpage the null value check (if their
name and password didn't match) would take them back to the login page. And,
you have other work to do. Other authentication behaviors dreamweaver will
write for you may be needed ALL of your pages to make sure the user is logged
in dreamweaver will write it for you too.. basically it does something like
if (Session{'username')=NULL) redirect('LOGIN.ASPX') of course, the
dreamweaver version is extra complex looking since it does some fancy error
checking. the code for this should be imbedded in each page (but the login) to
make sure they didn't link inside your passworded site without loggin in. rm
RichMcCrea Guest



Reply With Quote

