| surfcaster 2005-03-05, 3:55 am |
| Hi, I have some code that I got from another source that appends the IP
and a STATE number to the calling URL then redirects it back to the perl
the same program. It does come back to the same program. The problem is I
can't get the IP/STATE number the was appended to the URL when it set by
"print $q->redirect($q->url() . "$session_key");"
Im running apache 2.0 and Linux 9.0. I have include part of the code and
the results when its is run.
Any help would be nice, and I have searched the Internet, but only find
examples not troubles.
Stan
CODE::::::::::::::::::::::::::::::::::::
:::
$session_key = $q->path_info();
print "<BR>session key : = ",$session_key,"<BR>";
# get rid of the initial slash
$session_key =~ s|^/||;
# If no valid session key has been provided,
# then we generate one, tack it on to the end of our URL
# as additional path information, and redirect the user
# to this new location.
unless (&valid($session_key)) {
$session_key = &generate_session_key($q);
print "\nAdding session key to be redirected back here! Key = ",
$session_key,"<BR>";
print "REDIRECT: ", $q->url() . "/$session_key";
print $q->redirect($q->url() . "$session_key");
exit 0;
}
RESULT:::::::::::::::::::::::::::::
session key : =
remote Address: 69.xxx.xxx.96
Adding session key to be redirected back here! Key = 69.xxx.xxx.96.6072
REDIRECT: http://69.xxx.xxx.96:8080/~ter/cgi-
bin/savestateex.pl/69.xxx.xxx.96.6072Status: 302 Moved
Location="http://69.xxx.xxx.96:8080/~ter/cgi-
bin/savestateex.pl69.xxx.xxx.96.6072/ "
|