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)
- wordpress avoid direct calls to this file (2)
- php disable direct acces (2)
- prevent direct access to wordpress file (2)
- avoid direct call php (2)
- wordpress prevent php direct access (2)
- prevent url direct access php (1)
- prevent video file using php (1)
- prevent php script from direct access (1)
- prevent directory access using PHP#sclient=psy-ab (1)
- preventing direct url acess by cookie in php (1)
- prevent direct url call with php (1)
- prevent direct url access to files using java (1)
- prevent direct page access login php cookies (1)
- prevent direct page access cookies login php (1)
- prevent direct image access wordpress (1)
- prevent direct access to php files in wordpress (1)
- prevent direct access to file in java (1)
- prevent direct access to a web page by php (1)
- protect wordpress file from direct access (1)
- secure video file from direct access using php (1)
- wordpress prevent direct page access (1)
- wordpress prevent direct calls to php pages (1)
- wordpress prevent direct access to php (1)
- wordpress prevent direct access plugin php (1)
- wordpress prevent direct access php (1)
- wordpress enable direct access (1)
- wordpress direct access (1)
- wordpress deny direct access to script (1)
- disable direct access to php file (1)
- wordpress avoid direct call php (1)
- wordpress avoid direct access file (1)
- stop direct script calls php (1)
- stop direct login by URL uing PHP (1)
- stop direct acess to ajax php file (1)
- simple way to prevent direct url access in php (1)
- prevent direct access by URL in php (1)
- prevent direc calling of captcha php (1)
- php script to avoid direct access of web page (1)
- php block direct access script (1)
You will also be interested in ,
- PHP Most Potentially Dangerous Feature, Secure It Today PHP Secrets
- Change background color using php for a webpage
- Import large files in mysql using PhpMyAdmin
- Speed up wordpress using .htaccess part 2
- Speed up wordpress using .htaccess part 1
- How to avoid direct access to a file in php
- Adding Handlers Directly In httpd.conf Of Apache
- Warning: session_start(): Cannot send session cookie headers already sent
- Sort MYSQL data according to the date in php or mysql itself
- Simple PHP Login Script

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