Some months before i have written a code to avoid the direct access of files using php, but now i have modified the previous script since it has some set backs, Let us take one file named MYFILE.PHP as an example, all you have to do is just add the below code on the top of all the script.
< ?php
if (!empty($_SERVER['SCRIPT_FILENAME']) && 'MYFILE.PHP' == basename($_SERVER['SCRIPT_FILENAME']))
die ('Please do not load this page directly. Thanks!');
?>
Always remember to change the file name accordingly.I have given that area in BOLD and CAPS
Incoming search terms:
- wordpress avoid direct calls to file (4)
- Insert one Checkbox Values to one Textbox Values in php (3)
- prevent direct access to php script (3)
- prevent direct access to wordpress file (2)
- wordpress avoid direct calls to this file (2)
- prevent direct access to wordpress page files (2)
- php prevent direct script access (2)
- wordpress prevent php direct access (2)
- php disable direct acces (2)
- avoid direct call php (2)
- prevent direct web page access (1)
- prevent directory access using PHP#sclient=psy-ab (1)
- prevent direct url access to video files (1)
- stop direct acess to ajax php file (1)
- prevent php script from direct access (1)
- prevent direct url access to files using java (1)
- prevent direct url call with php (1)
- prevent direct url access (1)
- prevent direct page access cookies login php (1)
- prevent direct image access wordpress (1)
- prevent direct page access login php cookies (1)
- prevent direct access to some wordpress pages (1)
- prevent direct access to php script ajax (1)
- prevent direct access to php files in wordpress (1)
- prevent direct access to file in java (1)
- prevent PHP version in response (1)
- prevent url direct access php (1)
- disable direct access to php file (1)
- preventing direct url acess by cookie in php (1)
- wordpress deny direct access to script (1)
- wordpress direct access (1)
- wordpress enable direct access (1)
- wordpress prevent direct access php (1)
- wordpress prevent direct access to php (1)
- wordpress prevent direct calls to php pages (1)
- wordpress avoid direct call php (1)
- wordpress avoid direct access file (1)
- prevent video file using php (1)
- wordpress prevent direct access plugin php (1)
- protect wordpress file from direct access (1)
You will also be interested in ,
- Find out which mode php is running CGI or DSO mode
- Getting Remote Webpage Info Using PHP
- Display mysql table using for loop in php
- Finding size of a directory using php
- MD5 Function and Unique ID in php
- Find any day before a given date using php
- Ajax Page With PHP
- View edit and save text file database using php
- File System Reference In PHP
- Store Data In Remote DataBase Using cUrl or Execute a HTTP POST Using PHP CURL


I’m happy! It is simple to see that you are passionate about your writing. Looking forward to future posts. Thanks!