I have a CGI script which is being called from many different pages. I need the CGI script to determine which page just called it.
Say we are at . We are including the CGI script as an SSI. The CGI has to output the URL of page1.shtml.
Just for the sake of it, I also used
My first idea was using $ENV{"HTTP_REFERER"}. I thought this worked at first but it turns out it only works if the page1.shtml is called directly. This is to say, if you are on and click a link to the CGI included on page1.shtml will say the referer was " and NOT page1.shtml which it should!
I have used both the SSI and the exec cgi code and using HTTP_REFERER but it's absolutely not working. Can someone tell me how I can get the URL of the page that called it?
Say we are at . We are including the CGI script as an SSI. The CGI has to output the URL of page1.shtml.
Just for the sake of it, I also used
Code:
<!--#exec cgi="../cgi-bin/stats/downloads.pl"-->
My first idea was using $ENV{"HTTP_REFERER"}. I thought this worked at first but it turns out it only works if the page1.shtml is called directly. This is to say, if you are on and click a link to the CGI included on page1.shtml will say the referer was " and NOT page1.shtml which it should!
I have used both the SSI and the exec cgi code and using HTTP_REFERER but it's absolutely not working. Can someone tell me how I can get the URL of the page that called it?