Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Forgot Password Perl script

Status
Not open for further replies.

meishi85

Technical User
Apr 3, 2004
6
US
Can someone please show me how to put together a "Forgot My Password" script - similar to those seen on many other Internet sites out there. What I want a link where a visitor may click and submit their email address or something...and then they will be sent their username/password automatically.

Thank you in advance.
 
What level of comfort/competency have you got with Perl so far?

--Paul
 
Unfortunately, I'm still a newbie trying to learn the ropes. I've been learning on my own for the past few months now. Do you have any sample code for me to look at or perhaps some guidance to point me in the right direction? Thank you for your reply.
 
Meishi,

Start off by defining your problem, and what your expectations of it are. The building blocks are readily available

--Paul

 
Defining my problem? Hmm...let's see.

I want to learn how to write a script which allow users to retrieve their username/password after having entered their email address.

My expectations?

Not much. Just anything that will get the work done. Nothing fancy. Something straight foward so I can comprehend the code level.

 
first, who/what knows the username & password? in what format?

the objective is to email the user their password.

so you need a form where the user enters their username/email address; your script matches the relevant record; emails the user the password.

<marc> i wonder what will happen if i press this...[ul][li]please tell us if our suggestion has helped[/li][li]need some help? faq581-3339[/li][/ul]
 
Where do the passwords come from? Are they in a database? The unix passwd file? some windows registry?

 
You guys brought out some interesting points.
Can I get your advice as to which is the safest method to store the password? In database or in unix passwd file or in registry??

The form creation with the email address submission is quite easy. What I need help with is the matching of the email address and then the automatic sending out of the username password. That is the part which baffles me.

There are many existing scripts out there which does this with .CGI or .PL (perl). Unfortunately, when I d/l them, I get raw HTML but not the source code. Oh fooey...



 
Your problem is not a 'forgot my password script', you core issue is that you do not have a datamodel or system architecture. Before you can 'retrieve a password' you have to understand how a user even 'logs in'.

Once you figure out how your app works a forgot my login script will be a secondary concern.

 
I have to agree with Siberian, it sounds as if you've got the cart in front of the horse. You need to do a lot of planning before you start writing a script. As mentioned, what, where, and how will you store passwords/usernames? How will they get there initially - via web page (user entered), manual entry (from email/snailmail/phone call), or will they be automatically assigned by some server-side application?

Answer these questions and you'll be almost ready to think about writing a script. Other considerations will be: what scripting language(s) does my web host support? (PERL, PHP, ASP, C, VB, ???). Who ar my potential users?, How many will there be? How many will be accessing this routine at the same time? Are there resource sharing conflicts I need to consider?

Answer all of these and you can start to outline your scipt.

Good luck!!

There's always a better way. The fun is trying to find it!
 

I am doing one authentication with web and store user password in mysql. If you want it, you can email me. : )

But, the problem is if you have enough priviledge, you can see the password from the db though.

Adam
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top