Skip to content

Instantly share code, notes, and snippets.

@AndiSHFR
Created January 17, 2017 11:18
Show Gist options
  • Save AndiSHFR/ab6e9577e66383bb78a863c25505393f to your computer and use it in GitHub Desktop.
Save AndiSHFR/ab6e9577e66383bb78a863c25505393f to your computer and use it in GitHub Desktop.
Protection against direct script calling.
<?php
// Protect agains direct calls from the web browser
if(1 == count(get_included_files())) {
http_response_code(404);
die( '<h1>404 Not Found</h1><p>The page that you have requested could not be found.</p>');
}
// More library code here
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment