LPM: CGI question
David Hempy
hempy at ket.org
Thu Jan 11 15:27:55 CST 2001
At 04:18 PM 1/11/2001 -0500, you wrote:
>I'm trying to figure out the best way of telling whether a script was
>invoked through a browser or from the command line. Right now
>I'm checking if ENV{"HTTP_HOST"} exists (yes = browser; no = command
>line). Does anyone know of a better way to do this?
>
>Thanks!
>Janine
That is precisely how I do it.
-dave
ps. Not quite related, but FWIW:
On occasion, I will forego using CGI for quick-and-dirty cgi scripts that
need minimal parameter support:
if ($ENV{SERVER_URL} =~ /preview/) {
## do different stuff
}
Probably doesn't save any trees in practice, but what the heck.
--
David Hempy
Internet Database Administrator
Kentucky Educational Television
<hempy at ket.org> -- (859)258-7164 -- (800)333-9764
More information about the Lexington-pm
mailing list