Jump to content

PHP security question


dk4210

Recommended Posts

Hello Guys,
Could you take a look at my code and see if it is secure enough or if I need to modify it to be more secure?.This is how I call my pages. My link looks something like this http://www.mydomain.com/index.php?content=myscript
and it works great, but I am concerned about the sccurity.. Thanks in advance for your help. Dan


$file = (empty($_GET['content']) ? 'main' : $_GET['content']);
if (file_exists($_SERVER['DOCUMENT_ROOT'] . '' . $file . '.php'))

{
include($file . '.php');
// print "ok"

}else
{
print "Page not available";
}
Link to comment
https://forums.phpfreaks.com/topic/28928-php-security-question/
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.