Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to obtain requesting HTML page's filename

Status
Not open for further replies.

artheim

Programmer
Jan 15, 2003
103
US
I have a html page that invokes a cgi script with the <script src= format. I would like to be able to determine the file name of the html page from within the cgi perl program. Is there a way to pass this info to the cgi as a parm? If so, how?
 
Just encode it into the SSI inclusiont ie

<script src= format.cgi?thisisfrom=namehtml>
 
Yes, I understand that.. what I was wanting to know is there any way to pick up the url of the html page within the page and pass that on to the cgi code without having to hard code it into the cgi call. It has happened more than once where several pages get moved/renamed and the hard coded information is not updated correctly.

Thanks for the response - sorry I was not clear on my initial post.
 
you can use the 'referer' method with the CGI module,
Code:
#!/usr/local/bin/perl
use CGI;
use CGI::Carp 'fatalsToBrowser';
use strict;

my $cgi = new CGI;
print $cgi->header,
      $cgi->start_html,
      $cgi->
[red]referer[/red]
Code:
,
      $cgi->end_html;
'hope this helps

If you are new to Tek-Tips, please use descriptive titles, check the FAQs, and beware the evil typo.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top