Jump to content

[SOLVED] Securing a script from direct access


quiettech

Recommended Posts

Hello all,

 

I'm wanting to secure a script from any other access than that of a require(). That is, the script cannot be ran directly, only as part of an include.

 

Currently I have only the script chmod to 600. But I would like top go that extra mile in securing this code. I believe this is done through .htaccess but am failing to find the proper syntax.

all you need is:

 

defined('INCLUDED_CONSTANT');

 

as an if statement at the top of the script you want securing.

----

 

then just put define("INCLUDED_CONSTANT",true);

 

at the top of your index php file.

 

 

hope this helps,

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.