I'm trying to set up a simple web page with login and registration
system before I try more complicated stuff.
I'm running into a problem where I redirect to a script, try to pull a
parameter off of the url and do something with it ( in this case, a
session id that needs to be removed from the database ). When I
redirect to the script, I print out the parameters and get they are
all empty, even though the url in the browser has them attached! If I
click on the address bar and press enter and reload the script, it
works fine. The page I am redirecting from also takes in parameters,
and it works fine! Any suggestions?
Thanks for the help!
Here's the code of interest:
# redirecting to this ( logout.pl )
my $cgi = new CGI;
my $sid = $cgi->param("sid");
my $username = $cgi->param("uid");
# check if session exists and then delete it
my $dbh = $ProjCfg::dbh;
my $dbName = $ProjCfg::dbname;
my $sessionTable = $ProjCfg::sessionTable;
my $sqlStmt = "DELETE FROM $dbName.$sessionTable WHERE id='$sid'";
$dbh->do($sqlStmt);
print $sqlStmt;
# redirecting from
$cgi = new CGI;
$sid = $cgi->param("sid");
$username = $cgi->param("uid");
print "<html> <head>
<title>Login Page</title>
</head>
<body>
<h1> Welcome $username with id number $sid</h1>
<form action='/cgi-bin/session/logout.pl?sid=$sid&' method='post'>
<input type='submit' value='Logout' name='submit'>
</form>
</body></html>";
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/