phpfileincludeaccess-rights

Prevent that anybody can open include file directly in his browser


I have a file named startpage.inc.php and I want to include it but prevent, that anybody can open it in his Browser. Is it possible?

Possible:

<?php
include 'inc/startpage.inc.php';
?>

To prevent:

www.example.org/inc/startpage.inc.php

Solution

  • You have several options.