> Hello!  :)
> 
> I have a script that loads another script with require() and based on
> the context, I'd like different things to happen.  So, index.php is
> calling the required file require.php.  And when require.php is run, if
> there's no HTTP_REFERER and the file is index.php, everything is OK.
> But if the file is accessed directly (say by GET) then I want an error
> to be thrown.  Reason being is require.php can also accept POST
> operations, but I don't want it to accept GETs, because it's not
> supposed to be used alone.  Problem is, when it's required with another
> file, GET is OK.  So basically, I want to detect if the file is being
> required or called on its own.  At least, that's what it sounds like I
> want to do from my above explanation.  Any ideas how I can accomplish
> this?  Thanks!  :)

I think $PHP_SELF is your friend!

hth
Michael

-- 
Aufgepasst - jetzt viele 1&1 New WebHosting Pakete ohne
Einrichtungsgebuehr + 1 Monat Grundgebuehrbefreiung!
http://puretec.de/index.html?ac=OM.PU.PU003K00736T0492a


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to