We Are Glad To Announce That Our Store Is Now Open,Get The Best Of The Best Products From Us At Good Prices.Just Click On Our Products Link

Wednesday, October 15, 2014

How To Protect Php Include Files From Direct Access



Php is a very popular programming language especially in the area of  web development.This Programming Language has uppermost porpularity than many of its predecessors. Php provides us with a lot of functions that help make our web development life easier especially the include and require functions along with these library of functions comes the need to protect our php scripts especially include and require functions and these is our tutorial on how to protect your php include files from direct access through the url
1) In The Script To Be Included add this code

define('IS_IN_SCRIPT',1);

2) In The Script Where You Will Be Including The File Add This New Code To It Before You Include The File



if(!define('IS_IN_SCRIPT')){
    die("Direct Access Denied");
}                                                                                       
else{}

3) Once You Have Done That Your Done.

       


0 comments: