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'); }
In reply to passing parameters by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |