Re: Perl And Apache.




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.

.



Relevant Pages

  • Re: [Way OT] perl, CGI, and sendmail
    ... >> Been experimenting with CGI, using perl. ... This is the standard format that came with the Debian install of apache ...
    (Debian-User)
  • Re: Apache and Perl in Windows
    ... The cgi scripts execute, ... I am studying a spider book that uses Perl so I ... > file in apache and rename the jar files in the server directory. ...
    (comp.lang.perl.misc)
  • Re: Help getting Perl/CGI running on OS X localhost with apache
    ... > I am trying to learn about perl and cgi. ... I have apache and php running ... Use a cgi-bin dir *outside* your document root. ...
    (comp.lang.perl.misc)
  • Re: Perl And Apache.
    ... >> After UserID/Password authentication on a web page, does Apache store the ... >> UserID in an environment variable that a Perl script could use? ... > use CGI; ...
    (comp.lang.perl.misc)
  • Re: Server permission problems and SchAgent
    ... > windows, apache, cgi, scheduler, perl. ... > I was using a CGI script in an Apache2/Win2k ...
    (microsoft.public.scripting.wsh)