sudarmj has asked for the wisdom of the Perl Monks concerning the following question:

Hi all,
This is the way my login proceeds.
1. Username password entered at login.html
2. Checked with access DB in login.pl and authenticated.
3. If successful then proceed to main.html

login.html -> login.pl ->main.html
The problem is after the login has been deemed successful, i want the script in login.pl to automatically bring up main.html without any user clicks or anything.
Any ideas on how to do this? Or please direct me to a resource where i can find this?
Here is the code where i need the above mentioned change.
if($checkpass eq $pass){ print "Login Successful"; #--> Instead of print, bring up main.html au +tomatically. }

This will enable me to even add a loading bar like the one you have after you enter your credentials in gmail.
Thanks!

Replies are listed 'Best First'.
Re: Login page query
by marto (Cardinal) on Jun 19, 2009 at 10:19 UTC

    Using CGI you could redirect:

    print redirect('http://mydomain/main.html');

    Though you perpahps want to store the fact the user has successfully authenticated in a server side session, as you should check in each subsequent page that the user has logged in. Again, see CGI for more details.

    Hope this helps

    Martin

Re: Login page query
by proceng (Scribe) on Jun 19, 2009 at 17:32 UTC
    Offtopic, but:
    You also should check out "HTML Code Convertor" http://www.filebuzz.com/fileinfo/6979/Html_Code_Convert.html. This is a freeware package that will take html code in and output perl, php and others. This will mean that you will have login.pl->main.html (or login.cgi->main.cgi).
    Just a thought... :-)