Hello, it seems i like everyones knowladge alot.. so ill be asking anoter question :)
I need to allow users to login to my website. Ive writen some code using HTML::Template. My understanding of CGI is not execatly very substantial and ive tried to work around this to create a login. Ive put a forms on my page and im using param('user') to get the password once its submitted. Then ive used an if() to see if it been submitted then i will do somthing else but for now its just a debug messege, but this doesn't seem to work. Here is my code
use strict; use HTML::Template; use CGI; my $login = "login <input type=\"text\" name=\"user\"> password <input + type=\"text\" name=\"pass\"> <input type=\"submit\" value=\"Submit\ +" name=\"submit\">"; my $template = HTML::Template->new(filename => "template"); $template->param(LOGIN => $login); ## Put an IF here after finding out + if they have a cookie / ticket :) ## $template->param(NAV => "blah blah"); $template->param(CONTENT => "woof woof"); my $cgi = new CGI; my $user = $cgi->param('user'); my $pass = $cgi->param('pass'); if ($user) { $cgi->start_html; print "Content-Type: text/html\n\n"; print "well HELLO"; $cgi->end_html; } else { $cgi->start_html; print "Content-Type: text/html\n\n", $template->output; $cgi->end_html; }
If anyone could help with this it would rock :)
Thanks
im the king of all i survey. my kingdom has lots of dust on it

In reply to Simple CGI Login by Xidus

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.