in reply to how to move to new page on successful login

I see some serious problems with your CGI-script.

What stops a user from directly going to http://localhost/cgi-bin/librarian.cgi?

You check for a valid user + password combination in your script and once you reach the other pages, how do these scripts know the user is valid and allowed to reach these pages?

Usually this is done through session-management and cookies and many modules exist that already implement this. Have a look at CGI::Session in that respect.

And while your are looking at modules, CGI::Auth or CGI::Session::Auth may just do what you are trying to achieve!

Perhaps you are trying to re-invent a web-framework and then modules such as Catalyst or CGI::Application are what you are looking for?

CountZero

A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James

Replies are listed 'Best First'.
Re^2: how to move to new page on successful login
by arnieboy (Initiate) on Feb 25, 2008 at 20:59 UTC
    Hi Countzero, Your points are very valid and I understand that I need something far more robust to actually restrict access to librarian.cgi. However, I have just started learning CGI/DBI and I want to figure out how to do a simple redirect, which somehow I cannot accomplish even after 6 hours of googling. Thanks and regards, Ken