PDA

Click to See Complete Forum and Search --> : username, password setup...?


DesignIt
06-01-2005, 03:13 PM
What is the process to set up a page (similiar to this site) where the user must enter a username (email address) and password.

If the user forgets the password, I would like to have it set up to send them the password to their email.

Is this an easy thing to setup?

Any help would be appreciated! =)
Thanks.

JPnyc
06-01-2005, 04:13 PM
Easy is a relative term ;). You need a database and you need some sort of serverside scripting language to connect to, and interface with it. Which you choose depends on what your page host supports. There are a number of options.

DesignIt
06-01-2005, 04:23 PM
My original request was kind of broad...here is more of what I am wanting:

What is the process to set up a Client Access page where the user must enter a username (email address or a prepicked username?) and password.

Only clients will be able to enter, not just anybody, so I am not sure how that will affect the coding.

If the user forgets the password, I would like to have it set up to send them the password to their email.

.cfm is at the end of documents currently, if that helps, as far as our server support. I think it is windows based, as opposed to Linux.

edit: I know that what we are wanting to do currently, does not require a database to support. If we want to add a lot of functionality down the road then we will have to convert it to a database.

Keyare
06-01-2005, 04:57 PM
You will still need some kind of database, even if it is a flat text file to pull the email addresses and passwords from. Look for some Cold Fusion Tutorials, like:http://tutorial8.easycfm.com/

JPnyc
06-01-2005, 05:49 PM
Doesn't affect it at all. The approach is still the same. You will need a database and serverside scripting.

DesignIt
06-01-2005, 06:10 PM
You will still need some kind of database, even if it is a flat text file to pull the email addresses and passwords from. Look for some Cold Fusion Tutorials, like:http://tutorial8.easycfm.com/


Great tutorials, thanks!!

I especially like the "image leeching" one. =)

Anywayzzz,
I was able to set up the username and password stuff. The only thing I am hazy on, is the code used if the user forgets their password. Then they would put in their username (email address). At that point we would send them the correct password to access the site.

Also, I have an area in the page where I am holding the usernames and passwords of the clients allowed access. This is what I have:


<CFIF isdefined("login") and isdefined("pw")>
<cfset Users = QueryNew("User,Password,SendToUrl")>
<cfset list=
"User2,Password,http://www.mysite.com/clients/welcome1.htm
useremail@hotmail.com,password,http://mysite.com/welcome.htm"
>
<!--- To add new clients add a new row to the above command with the followingformat
user,password,urltoforwardtoonsucess --->
<cfloop index="row" list="#list#" delimiters="#chr(10)#">
<CFIF listlen(row) gte 3>
<cfset username=listgetat(row,1)>
<cfset password=listgetat(row,2)>
<cfset href=listgetat(row,3)>
<!--- <cfoutput>Username:#username#-Password:#Password#--login:#login#-PW:#pw#<br></cfoutput> --->
<CFIF username eq login and password eq pw>
<cflocation url="#href#">
</cfif>
</cfif>
</cfloop>

THIS IS WHAT I AM TRYING TO REPLACE WITH A PASSWORD SO WE DON'T HAVE TO BE CONTACTED.

<cfset msg1="Invalid User Login">
<cfset msg2="Try again. If you are experiencing problems contact ">
<cfset msg3="help@mysite.com">

</cfif>

Roo-1
06-01-2005, 07:34 PM
If your host allows you to password protect directories you can do this simply via your control panel.

If your hosts has decent features when you login to the CP, you'll see a Password Protect Directories option. This allows you to create a directory and specify a user name and password for access.

If you don't have this option, yes you'll need something like a php script with database, or cgi script.

Patrick Shannon
06-01-2005, 07:43 PM
Roo speaks of .htaccess, although that is more useful for a few individuals as opposed to a wide array of clients with individual logins and passwords. .htaccess is very minimalist for such a purpose, a database solution is what you want to go with. If you are familiar with PHP and MySQL or some other database, that's all the better.

DesignIt
06-01-2005, 08:19 PM
Note to Employers: If you search the skies for a Superman, you're going to overlook the people on Metropolis doing equally amazing things.

I like. =)

Oh, and thanks for the feedback everyone! =)

Keyare
06-01-2005, 08:20 PM
Anywayzzz,
I was able to set up the username and password stuff. The only thing I am hazy on, is the code used if the user forgets their password. Then they would put in their username (email address). At that point we would send them the correct password to access the site.

Also, I have an area in the page where I am holding the usernames and passwords of the clients allowed access. This is what I have:


THIS IS WHAT I AM TRYING TO REPLACE WITH A PASSWORD SO WE DON'T HAVE TO BE CONTACTED. [/COLOR][/B]

<cfset msg1="Invalid User Login">
<cfset msg2="Try again. If you are experiencing problems contact ">
<cfset msg3="help@mysite.com">

</cfif>[/I]
You would probably have to turn this into a hidden form, with their email address and PWD in it, which would send the data to their email address on submit

Patrick Shannon
06-01-2005, 08:41 PM
I like. =)

It's a reference to a situation back in April where one job candidate (who has already made their career) was picked over me because "he was a Superman for the salary he was willing to work for." If that company ever calls me back, this is exactly what I'm going to say to them the next time.

Ulysses
06-01-2005, 08:41 PM
Using a .htaccess file in the root directory of the page is the quickest way. Contact you hosting provider for help on this.