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


Comments


You need to login to view comments.