in reply to CGI Parameters
#!/usr/bin/perl use strict; use warnings; use CGI; use Data::Dumper; my $q = CGI->new(); my %var = $q->Vars(); my $log_file = '/path_to_log'; open(LOG,">>$log_file") || err("Can't open log file: $!"); print LOG "URL: $ENV{REQUEST_URI}\n\n", Dumper(\%var,\%ENV)."\n\n", '=' x 60, "\n\n"; print $q->header('text/plain'). "Everything's OK"; sub err { print $q->header('text/plain'). "ERROR: $_[0]"; exit(0); } exit(0);
Save that as MyScript.pl and set $log_file to point to a file that you can write to.
Then, when the script is called:
So, you can call it with various query string info to see what variables get set, and you can ask your manager to request the URL so that you can see exactly what HTTP header his request is sending.
Hope this is useful to get you started.
cLive ;-)
Update: added err() sub (oops :)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: CGI Parameters
by Gerard (Pilgrim) on Jan 12, 2004 at 20:10 UTC |