Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
I want the second file "de.pl" to get this parameter and do something with it. It works fine when I put in the first script username=pat but not when I put username=$username. What am I doing wrong? Thank you#!c:/perl/bin/perl.exe use DBI; $,="\t"; use CGI qw(:all escape); $username=param("username"); $password=param("password"); $condition; $cond; $db=DBI->connect("dbi:mysql:administration") or die"\n Error($DBI::err +):$DBI::errstr\n"; $aquery="select pass from password where username='$username'"; $a=$db->prepare($aquery); $a->execute(); while(@result=$a->fetchrow()) {foreach $result(@result) { if ($result eq $password) {$condition=1; } } } if($condition==0) {print"content-type:text/html\n\n"; print"<html>\n"; print"<body bgcolor=\"#990000\"><font color=\"white\">"; print "Sorry but your password does not match your username. Please tr +y again. <br><form action=\"login.pl\" method=\"post\" target=\"mainF +rame\">Username: <input type=\"text\" name=\"username\" size=\"15\">< +br><br><br> Password: <input type=\"password\" name=\"password\" size=\"15\"><br>< +br><br><center> <input type=\"submit\" value=\"Submit\"></form></center>" ; } else { print redirect(-location=>'http://localhost/cgi-bin/de.pl?username=$us +ername'); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: passing parameters
by dragonchild (Archbishop) on Jul 21, 2003 at 13:32 UTC | |
by Anonymous Monk on Jul 21, 2003 at 13:39 UTC | |
by dragonchild (Archbishop) on Jul 21, 2003 at 13:49 UTC | |
by diotalevi (Canon) on Jul 21, 2003 at 14:04 UTC | |
|
Re: passing parameters
by antirice (Priest) on Jul 21, 2003 at 13:32 UTC |