in reply to Re: Stuck
in thread Stuck
Here are my own thoughts on your problem:
This will give you debugging information that will be output into your Error_Log for Apache, or IIS, or whatever you're using. As it stands, your code is VALID (as far as I can see), it just doesn't do what you want it to. Turning warnings on won't fix this problem directly, but it might help you understand what's going on a little better.#!/usr/bin/perl # no warnings #!/usr/bin/perl -w # warnings enabled
Just running that snippet and checking the Error_Log will let you determine if your split is running properly, if you're using the correct environment variable, if you're making your array call correctly, et cetera. Based on the output value of $where you can figure out where your (first) problem is.#!/usr/bin/perl -w @all = split(/?/,$ENV{'HTTP_REFERER'}); $where = @all[1]; die $where;
Keep this in mind.A) http://www.host.com/cgi-bin/test-script.pl B) http://www.host.com/cgi-bin/test-script.pl?param=value C) http://www.host.com/cgi-bin/test-script.pl?param=value&color=blue 1: #!/usr/bin/perl -w 2: 3: warn $ENV{'QUERY_STRING'}; Line 3 returns: A) blank (null string, no data) B) param=value C) param=value&color=blue
Now you can call this script like this: /cgi-bin/locator.pl?where=Front And 'Front' will be written to your Error_Log. Simple, right?#!/usr/bin/perl -w use CGI; use strict; my $cgi = new CGI; # this creates a new CGI object my $where = $cgi->param('where'); warn $where;
Mostly I've just echoed what's already been written in reply to your first post. There's not much more we can give you.
Good luck.
'kaboo
PS - If you're having all this trouble trying to do this in Perl, you're going to have a seizure trying to do it in JavaScript. 'nuff said.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Still Stuck
by Chady (Priest) on Dec 16, 2000 at 22:15 UTC | |
by Chady (Priest) on Dec 21, 2000 at 01:27 UTC |