please comment on the following methods of preventing cross site
scripting and/or other nastiness:
1:
$pages = array('home','c ontact','about' ,'links' );
// could also build this array with readdir('MySafe Dir') ??
if( in_array($_GET['page'], $pages) )
{ include $_GET['page'].".php";}
else {die("Nice Try."); }
2:
include "my_prefix_".$_ GET['page'].".php";
3:
include "my_safe_di r/".$_GET['page'].".php";
4:
include_path=". :/myIncludes";
include $_GET['page'].".php";
--
thanks for your time
juglesh
scripting and/or other nastiness:
1:
$pages = array('home','c ontact','about' ,'links' );
// could also build this array with readdir('MySafe Dir') ??
if( in_array($_GET['page'], $pages) )
{ include $_GET['page'].".php";}
else {die("Nice Try."); }
2:
include "my_prefix_".$_ GET['page'].".php";
3:
include "my_safe_di r/".$_GET['page'].".php";
4:
include_path=". :/myIncludes";
include $_GET['page'].".php";
--
thanks for your time
juglesh
Comment