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!

How to preload user data on form via cookie & Perl/CGI?

Status
Not open for further replies.

JCHallgren

Technical User
Dec 17, 2004
47
US
Hi! (Was told to post this here for better answers)

New to this (HTML/PERL) but have just read most ALL the SSI Faq links..

Have a simple chatroom based on a variant of a guestbook script...works fine...but would like to save users name/city/st (after a succcesful posting) so that when they return again, i might (assuming cookie was there) preload those fields in FORM data as initial values...

Have a main index page...it links to the "ADD" page...would using SSI on ADD page to do a "include virtual cookie.pl" type req work? So that it would read cookie data and modify the HTML for the page? But then...wouldn't I have to have all the ADD page code embeded in the PL pgm? Which makes the ADD page hard to maintain...

How should i approach this issue?
I want to have this be VERY secure also!

Hope you understand my questions! THANKS!



 
Even using SSI tags (and an underlying Perl script) to create the Cookie, your output HTML needs to know to read the cookie, so either Javascript will have to be used, or you'll need to look into a Perl solution for the entire thing.

If you go with the latter, to keep your code and presentation separate, have a look at either HTML::Template or Template::Toolkit modules as options. There are more modules in Perl that do this sort of thing, but I find these two to be the most robust.

- Rieekan
 
Thanks!...that HTML::Template was something i was unaware of...it might help in this process..

Should I use Javascript, would that work with all browsers?
Including WebTV? (My knowledge of JS is about nill)
Or is it done on the host/server side?
 
You stated earlier that you wanted to keep all validation within the JavaScript, so my answer was supporting that request. You could just as easily have Perl do your validation and bring the user back to the input page if you'd like.

Javascript won't be the same on WebTV and old browsers (Netscape 4, IE 4, etc.)

- Rieekan
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top