in reply to Simple CGI Login

I'd be looking to change that to something like this:

if ($user) { print $cgi->header,$cgi->start_html,"Hi there!", $cgi->end_html; } else { print $cgi->header,$cgi->start_html, $template->output,$cgi->end_html; }
Printing the content type is handled by the "header" method of the CGI object.


Peter L. Berghold -- Unix Professional
Peter -at- Berghold -dot- Net; AOL IM redcowdawg Yahoo IM: blue_cowdawg

Replies are listed 'Best First'.
Re^2: Simple CGI Login
by Xidus (Novice) on Aug 31, 2006 at 00:02 UTC
    It is preferable to run print the header that way but it doesn't have to be. The problem is when i put a user/pass into the fields and click submit, nothing happens, unlike i think it should....
    im the king of all i survey. my kingdom has lots of dust on it
          The problem is when i put a user/pass into the fields and click submit, nothing happens, unlike i think it should

      Where in the code you submitted are you processing the data coming back from submission? Where are you starting the form? What does the form look like?


      Peter L. Berghold -- Unix Professional
      Peter -at- Berghold -dot- Net; AOL IM redcowdawg Yahoo IM: blue_cowdawg
        The form is here and i put it into my html using a HTML::Template VAR later in the code
        my $login = "login <input type=\"text\" name=\"user\"> password <input + type=\"text\" name=\"pass\"> <input type=\"submit\" value=\"Submit\ +" name=\"submit\">"; ..... $template->param(LOGIN => $login);
        Then i try and get the variables using $cgi->param('user'); etc :)
        im the king of all i survey. my kingdom has lots of dust on it