Hi,
Is it possible to execute cgi scripts in .htaccess protected directories,
and to have these scripts call other scripts in the same directory?
I'm using CGI scripts to generate forms. The scripts are located in
directories protected by a .htaccess mechanism. The action for the first
form (lets call it foo.cgi) is a second cgi script (let's call it test.cgi).
Let's say that foo.cgi (written in tcl) has something like.
#!/usr1/bin/tclsh
puts "Content-type: text/html\n"
puts "<Head>"
puts "</head>"
puts "<BODY >"
puts "<FORM ENCTYPE=\"multipart/form-data\" NAME = form_er METHOD=POST
ACTION=\"test.cgi\">"
puts "<H3>File Information</H3>"
puts ""
puts "CAD System :<SELECT NAME=\"cadsrc\"> "
puts " <OPTION> Pro/Engineer"
puts " </SELECT> <P>"
puts "<input type = submit value = \" Send \"> <INPUT TYPE=reset
VALUE=\" Clear Entries \">"
puts "</FORM>"
Assuming that all test.cgi does is print out the environment variables.
#!/usr1/bin/tclsh
puts "Content-type: text/html\n"
puts "<HTML>"
puts "<HEAD>"
puts "<TITLE>User has been registered</TITLE>"
puts "</HEAD>"
puts "<BODY >"
foreach name [array names env] {
puts "$name is $env($name) <br>"
puts "</BODY>"Quote:}
puts "</HTML>"
The problem I'm having is that having authenticated properly to foo.cgi,
the authentication is not recognized when I "submit" the action (and
try to execute test.cgi). If I place test.cgi in an unprotected directory,
I have no problem completing the action from foo.cgi. BUT, I no longer
have the REMOTE_USER environment variable properly set (which I
need for my application). I have no problem executing test.cgi directly
(i.e., opening http://my.www.server/test.cgi)....I simply authenticate
and the REMOTE_USER variable is set and echoed back to me.
All of this is with Apache 1.0.2.
Any help with this matter would be appreciated.
thanks.
-bill