ev5unleash Posted June 8, 2008 Share Posted June 8, 2008 Someone tell me if this is a good script to be requesting pages <?php if ($_GET['request'] == "welcome") { include("homepage/welcome.html"); } if ($_GET['request'] == "cc") { include("homepage/cc.html"); } ?> Link to comment https://forums.phpfreaks.com/topic/109322-safe-script/ Share on other sites More sharing options...
keeB Posted June 8, 2008 Share Posted June 8, 2008 Yes. Link to comment https://forums.phpfreaks.com/topic/109322-safe-script/#findComment-560759 Share on other sites More sharing options...
pocobueno1388 Posted June 8, 2008 Share Posted June 8, 2008 If you don't want a ton of if statements, you can just use an array. <?php $files = array('welcome', 'cc'); if (in_array($_GET['request'], $files)){ include("homepage/".$_GET['request'].".html"); } ?> Link to comment https://forums.phpfreaks.com/topic/109322-safe-script/#findComment-560762 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.