Dutch PHP Conference 2025 - Call For Papers

Voting

The Note You're Voting On

fili at fili dot nl
19 years ago
To prevent direct calls to included files i use the following technique.

In the main file create an empty function with a random name. Like so:

<?php
function hjudejdjiwe() { return true; }
?>

Then check for the existence of this function within your include:

<?php
if (!function_exists('hjudejdjiwe')) { die('!'); }
?>

Simple but effective.

<< Back to user notes page

To Top