in reply to Re: how to move to new page on successful login
in thread how to move to new page on successful login

Hi pcc88mxer, Thanks a lot for the reply. I do not quite understand how to defer printing the header after I have checked the user info. Could you kindly elaborate? Without the header at the beginning (before the HTML block), the server is throwing an error and the page is not being created. How do I make the redirect go to HTTP header (so that I can use it instead of q->header(...))? I am sorry.. but I am really new to all this. Thanks and regards, Ken
  • Comment on Re^2: how to move to new page on successful login

Replies are listed 'Best First'.
Re^3: how to move to new page on successful login
by pc88mxer (Vicar) on Feb 25, 2008 at 22:47 UTC
    You'll either do the redirect or you print the header and emit an HTML page:

    use CGI; ... $q = new CGI; my $login_ok = check_login($q); if ($login_ok) { $q->redirect(...); } else { $q->header(...); # emit html page }
Re^3: how to move to new page on successful login
by chromatic (Archbishop) on Feb 25, 2008 at 22:14 UTC

    Move the code that checks for the user's credentials before the code that prints anything.