Forum Moderators: coopster
Would it be secure if I checked the $_get to see if the first few characters are "../" and if they are then die() is there anything else the variable could start with that could be insecure?
if(preg_match($_GET['l'],'#^[a-z0-9-_]+$#i') && file_exists('pages/' . $_GET['l'] . '.php')) {
include('pages/'.$_GET['l'].'.php');
} else {
die();
}
if(preg_match('/[0-9a-z-]/i',$loadPage) && file_exists('pages/' . $loadPage . '.php')) { if(preg_match('/^[0-9a-z-]+$/i',$loadPage) && file_exists('pages/' . $loadPage . '.php')) {