in reply to Redirect page (newbie)

You've already printed the header. This means you are getting two headers.

If you want to redirect, you have to only print the redirect header.

Why are constructing your html with perl? You could make your setup infinitely better by turning this script into two parts. First, put your login form in a static html page and then have your cgi script do the validating and redirecting.

For example, you go to login.html which you put your username/password in. When you submit your form, you go to cgi-bin/login.cgi which authenticates your credentials and redirects to myview.cgi.

Also, how is your myview.cgi authenticating? Can I bypass your security by going staight to myview.cgi?

Replies are listed 'Best First'.
Re: Re: Redirect page (newbie)
by lauragarcia (Acolyte) on May 04, 2001 at 22:01 UTC
    I'm constructing the html with perl because once I discovered one could it seemed more efficient. Until now, when a problem like this pops up and shows a good reason for not doing so.

    As for your thornier question about authentication (which I'm grateful for by the way), my shameful answer is yes--one can go straight to myview.cgi anyway. I know: this is ridiculous. But as a newbie, I'm overcoming programming hurdles step by step. It's going to be a long road...

    So, what should I be looking up here at the site to find out everything I need to know about authentication?

    laura.guimauve

      Well, my best advice is to read the manuals for your webserver software. Generally, they have authentication mechanisms built into them.

      If you are using Apache, go to apache.org and search around for 'AuthBasic' .. there are more authentication schemes available that use cookies, databases and other goodies as well.

      enjoy.

      Oh hey - another comment that may help you. If you want to password protect a web page on a Unix based system, you should read about htpasswd.

      Here is one explanation of how to set it up.

      It's really simple to set up, and is quite secure. No worries about someone bypassing authentication and loading a web page they shouldn't see.

        Thanks alot, Galen, I'll take a look at it...
        laura.guimauve
        htpasswd only works with the Apache webserver, however.

        And, although the documentation says that it works with both the Unix and Windows versions of Apache, I have only been able to get it to work with the Unix version of Apache.