[thelist] Filled form field on back button

Tony Light TonyLight at blueyonder.co.uk
Wed Dec 11 12:01:17 CST 2002

[ Picked text/plain from multipart/alternative ]
Flavia Tarzwell wrote:

> I have 3 pages that to be able to access their content the user has to
> login. Each page does a username/password check against the db and if
> correct it loads the info if not it loads a page called register with
> the login form.
> The problem is that every time it goes to login (4 fields need to be
> correct) all the fields are empty again.

Sounds like a job for a cookie to me.

When the user logs in, write a cookie containing the variables you need populating.
You could use a server-side language to do this on receipt of the login form,
or you could use Javascript triggered by submitting the form.
Whenever the login page is shown, use Javascript to check for the existence of the cookie.
If it exists populate the fields.

Usual proviso - it obviously will not help people with client-side scripting turned off.




More information about the thelist mailing list