Beyond the Basics |
"Action" Input and Conditionals |
Christopher
Moderator
Member Rara Avis
since 1999-08-02
Posts 8296Purgatorial Incarceration |
Cannot understand where I'm having a problem here, and it's something I really would like to have, so I don't end up with a different script for everythign I want to do. This should simply print a form if it receives no $action" or print a single line if it receives the $action of "login." No matter what I do, it gives me the form each and every time and I can't, for the life of me, see why. I appreciate any hints! ********** #!/usr/local/bin/perl require "toolbox.pl"; inputIn(); $email = $input{'email'}; $password = $input{'password'}; $action = $input{'login'}; if (! $action) {printForm();} elsif ($action eq "login") { header(); print qq~Action = $action~; footer(); } ##################### #####SUBROUTINES##### ##################### #Print HTML form to login with sub printForm { header(); print qq~<form method="post" action="login.pl"> <div align="center"> <table width="350" bgcolor="#6699cc" cellpadding="0" cellspacing="0" border="0"> <tr> <td height="30" valign="bottom"> <img src="imgs/1.gif" width="1" height="1" hspace="35"><strong>Email Address</strong> </td> </tr> <tr> <td height="30" valign="top"> <img src="imgs/1.gif" width="1" height="1" hspace="35"><input type="text" name="email" size="30" maxlength="50" value=""> </td> </tr> <tr> <td height="30" valign="bottom"> <img src="imgs/1.gif" width="1" height="1" hspace="35"><strong>Password</strong> </td> </tr> <tr> <td height="30" valign="top"> <img src="imgs/1.gif" width="1" height="1" hspace="35"><input type="password" name="password" size="30" maxlength="50" value=""> <input type="hidden" name="action" value="login"> <br> </td> </tr> <tr> <td height="10" valign="top"> <br> <div align="center"><input type="submit" value=" Submit "><input type="reset" value=" Reset "></div> <br> </td> </tr> </table>~; footer(); }#End SR printForm [This message has been edited by Christopher (12-14-2002 05:46 AM).] |
||
© Copyright 2002 C.G. Ward - All Rights Reserved | |||
Christopher
Moderator
Member Rara Avis
since 1999-08-02
Posts 8296Purgatorial Incarceration |
I wonder if I can set a timer letting me know when I should stop looking at the code because I'm not paying attention to the right things? Nevermind - I figured it out. $action = $input{'action'}; uhm - duh. |
||
⇧ top of page ⇧ | ||
All times are ET (US). All dates are in Year-Month-Day format. |