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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

converting scripts from local to cgi-bin directory

Status
Not open for further replies.

profp

Instructor
Feb 1, 2004
3
0
0
US
I have a set of scripts for race administration that are being employed by different users. The code was developed to run in the users own directory (all directories are on the same Unix server). Each user has a locally modifiable configuration file that is called ('use') by the scripts but they presently have to have their own copies of the scripts as well.

I'd now like to be able to put the common scripts into a single location (inaccessible to the different users) and let all configuration, reads, and writes be constrained to the directory of their individual 'operating' htmls.

The "hitch in the gitalong" is 'use', 'read', and 'write' statements in the common code. I'm seeking a simple way to "prefix" the individual directory location to the calls... can anyone suggest an 'easy fix'? (e.g. I do require the 'referrer' variable to ensure the code is only accessed from the server html so perhaps some brief code to dissect that handle might be a possibity?)

Thanks
 
Update - using $ENV{http_referer} then splitting it to extract the HTML directory that calls the first script works but subsequently generated html pages then refer to the cgi-bin directory. I can then pass the directory info via a hidden form variable but that seems tedious. Reading and writing to local directories doesn't seem like an unusual task for those running scripts from cgi-bin directories so I still feel that I have not identified the "best" solution.

Anyone have any ideas?

Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top