hi....can i ask something? i need to set a default password for a sign up form... so when new user sign up, they will get a default password and for the first time they log in, they will received a prompt or a msessage asking them to change their password. how can i fix that?

Recommended Answers

All 3 Replies

Two questions: 1) Why do you need a default password?
2) How is the default password generated?

You need to create another column or entity that will hold a value to show whether or not the default password was changed.

If you are working with a database (and not a text file or so) then you can create a new column for this, let's call the column pchanged.

Upon user registration, pchanged will get a value representing that the password is still at default, let's say this value is set to 0.

Now when the user logs in, the value of pchanged will be checked. If it is 0, a prompt or some sort of notice on the page will inform the user to change default password.

Once the password is changed, pchanged should be set to some other value besides 0, so that the notice/prompt won't call user attention again.

You will need to understand if..else/switch statements to accomplish this task.

As well as good understanding on how to retrieve and manipulate data from whatever storage protocol you are utilizing.

Hope that helps.

Two questions: 1) Why do you need a default password?
2) How is the default password generated?

i need a default password that is set when new user sign up... because the sign up process will be doen by the admin..and admin need a default password instead of asking the password from user.. n the password is generated by setting in the coding

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.