Simple way to check that an include isn't being directly called

/ Published in: PHP
Save to your folder(s)

Copy this code and paste it in your HTML
  1. if(count(get_included_files()) ==1) exit("Direct access not permitted.");

Report this snippet


RSS Icon Subscribe to comments

You need to login to post a comment.