Jump to content

Securing PHP Includes


R8kit

Recommended Posts

Hey everyone,

 

I am trying to secure php includes and I wrote the following lines:

 

<?php
$dir=scandir('.');

if (in_array('copyright.php',$dir)) {
include('copyright.php');
}
else {
echo 'That page could not be found';
}
?>

 

Is this code secure enough, can anyone help me improve it?

 

Thanks in advance.

 

Link to comment
https://forums.phpfreaks.com/topic/246933-securing-php-includes/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.