Re: does anyone know how to tell if a PHP scrip is being executed from the command line not a server HTTP request??
| From: | Robert Cummings | Date: | Sun, 06 Jul 2003 11:54:56 +0000 |
| Subject: | Re: does anyone know how to tell if a PHP scrip is being executed from the command line not a server HTTP request?? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-154116@lists.php.net to get a copy of this message | ||
I don't know if it is a great way, but it has worked for me for a long
time now. I make the following test:
isset( $HTTP_SERVER_VARS['SERVER_PORT']
Cheers,
Rob.
On Sun, 2003-07-06 at 04:48, Jeffrey D. Means wrote:
> I am trying to write a script but for security I need to verify that it is
> not executed by a web server. At this point I have just placed it outside
> the htdocs tree but would like to build into the script a test to die if it
> is being executed by a web server.
>
> Thanks
>
> Jeff Means
> CIO for MeansPC
> meaje@meanspc.com
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--
.---------------------------------------------.
| Worlds of Carnage - http://www.wocmud.org |
:---------------------------------------------:
| Come visit a world of myth and legend where |
| fantastical creatures come to life and the |
| stuff of nightmares grasp for your soul. |
`---------------------------------------------'