This option will reset the home page of this site. Restoring any closed widgets or categories.

Reset

Avoid direct access to a file in php enhanced version

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

VN:F [1.5.7_846]
Rating: 0.0/10 (0 votes cast)
VN:F [1.5.7_846]
Rating: 0 (from 0 votes)

Related posts:

  1. How to avoid direct access to a file in php
  2. Disabling right click menu using javascript Enhanced Version
  3. Append data to a text file using php
  4. How To Avoid 404 Error Pages Easily and Reliably
  5. Simple file upload script using php

1 Comment

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

    VA:F [1.5.7_846]
    Rating: 0.0/5 (0 votes cast)
    VA:F [1.5.7_846]
    Rating: 0 (from 0 votes)

Leave a Reply

Comments (required)

Spam Protected