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"); } ?> Quote 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. Quote 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"); } ?> Quote Link to comment https://forums.phpfreaks.com/topic/109322-safe-script/#findComment-560762 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.