Talk About Network



Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Perl Beginners > trouble with cg...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 1 Topic 11004 of 11065
Post > Topic >>

trouble with cgi::session- redirects and getting params

by mail.flacco@[EMAIL PROTECTED] (Nflacco) Apr 28, 2008 at 08:57 PM

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>";




 1 Posts in Topic:
trouble with cgi::session- redirects and getting params
mail.flacco@[EMAIL PROTEC  2008-04-28 20:57:59 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Thu May 15 0:25:51 CDT 2008.