I need some help with my script. i have the code below, which i think will do what i want it to. How can i make it into an actual working page? At the moment it just gives me "internal server error"
I basicly have a program that sets a cookie using the pm_encode function. i am trying to make a page that will grab the cookie decode it using pm_decode and place the cookie back with a different name. Any help is greatly apreciated.
David
#!/usr/bin/perl
###############################
# find the root if this is IIS:
###############################
if($ENV{'SERVER_SOFTWARE'} =~ m/IIS/)
{
if($root eq "" && $ENV{'PATH_TRANSLATED'} ne "")
{
my $pt = $ENV{'PATH_TRANSLATED'};
my @pts = split(/\\/, $pt);
$pts[-1] = "";
$root = join "/", @pts;
$OS = "NT";
}
}
my $lp = $req->cookie("pmpre");
my ($clogin, $cID) = split(/\|/, pm_decode($lp));
my $cookie_pmpre_login = $req->cookie(
-NAME => "username",
-VALUE => "$clogin",
-EXPIRES => "+1y",
-PATH => "/"
);
print $req->header(-COOKIE => $cookie_pmpre_login);
exit;
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.