I have a page where the user can enter his username and password. Does anyone have any examples on how to check the database for to make sure the user matches the username and password.

Thanks!!!

Recommended Answers

All 2 Replies

Something like this should do it:

<CFQUERY name="login" datasource="#dsn#">
SELECT *
FROM Users
WHERE UserName='#username#'
AND Pwd = '#pwd#'
</CFQUERY>

Of course your datasource, table name, fieldnames, and variables have to match your situation.

I have a page where the user can enter his username and password. Does anyone have any examples on how to check the database for to make sure the user matches the username and password.

Thanks!!!

Thanks, worked good.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.