Re: Perl And Apache.
- From: "it_says_BALLS_on_your_forehead" <simon.chao@xxxxxxxxx>
- Date: 23 Oct 2005 18:18:39 -0700
Morris.C wrote:
> A quick Perl (or it could be Apache!) question:
>
> After UserID/Password authentication on a web page, does Apache store the
> UserID in an environment variable that a Perl script could use?
>
> I've used a Perl script called 'test-cgi', but the UserID that it always
> returns is "apache".
>
> Any help would be appreciated.
>
> Thanks.
if you are using the CGI module, you have access to any html form
values that you submitted through POST, or that you entered in the
query string.
so if on one page, you had a link (or form action to) /cgi-bin/page2.pl
in page2.pl, you could have:
#!/usr/bin/perl
use strict; use warnings;
use CGI;
my $user = param('user');
print "Content-type: text/html\n\n";
print "$user<br>\n";
....if on the first page you had:
<input type=text name=username id=username value="">
something like that. the id is optional, but CGI requires that the html
tag have a name attribute.
.
- Follow-Ups:
- Re: Perl And Apache.
- From: it_says_BALLS_on_your_forehead
- Re: Perl And Apache.
- References:
- Perl And Apache.
- From: Morris.C
- Perl And Apache.
- Prev by Date: Perl And Apache.
- Next by Date: Re: Perl And Apache.
- Previous by thread: Perl And Apache.
- Next by thread: Re: Perl And Apache.
- Index(es):
Relevant Pages
|