Re: passing page URL to SSI script

2003-03-15 Thread Wiggins d'Anconia


javamaster wrote:
I am including the same CGI script as an SSI on several web pages. I 
need to know which page the script was run from (something like the 
javascript window.location variable). I want to be able to know if the 
script was executed from index.html, or contact.html, or products.html, 
etc. I cannot find anything and I was wondering if anyone had any ideas. 
Thanks.

The other answer was probably best, about checking ENV, the other option 
would be to add an argument to the script call and just check for it in 
the script like you would on the command line, in other words, in @ARGV. 
Though this makes it harder to copy and paste code, and you will have to 
remember to set it on every page

http://danconia.org

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


RE: passing page URL to SSI script

2003-03-11 Thread Peter Kappus
If you're using Apache, you can read from the magical environment hash to
see what URL the script was called from.

try this:  $ENV{'REQUEST_URI'};

or print them all like so:
print $_ .   .$ENV{$_} . BR for(keys(%ENV));

I'm not sure how this behaves with other servers such as IIS, but it's
probably worth a look.

good luck,
-Peter K.



-Original Message-
From: javamaster [mailto:[EMAIL PROTECTED]
Sent: Tuesday, March 11, 2003 2:35 PM
To: [EMAIL PROTECTED]
Subject: passing page URL to SSI script


I am including the same CGI script as an SSI on several web pages. I 
need to know which page the script was run from (something like the 
javascript window.location variable). I want to be able to know if the 
script was executed from index.html, or contact.html, or products.html, 
etc. I cannot find anything and I was wondering if anyone had any ideas. 
Thanks.

Tim Brom
[EMAIL PROTECTED]



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]