Woops yea its meant to be $_GET as $_REQUEST has security holes in as it can get from cookies aswel.
Edit// Fixed, and don't quote whole posts, it looks a complete mess.
Woops yea its meant to be $_GET as $_REQUEST has security holes in as it can get from cookies aswel.
Edit// Fixed, and don't quote whole posts, it looks a complete mess.
Thats probs the best way to do it. Simply add all your pages to /content/ then save that as index.php and include files by using; index.php?page=filenamewithoutdotphpontheendPHP Code:if ( isset ( $_GET['page'] ) ) {
$file = "content/" . $_GET['page'] . ".php";
if ( file_exists ( $file ) ) {
include ( $file );
}
else {
include ("404.php");
}
}
else {
echo ( "Epic fail: No GET was set." );
}
Lets set the stage on fire, and hollywood will be jealous.
I highly disagree with you on that method. Seems like a lazy way and makes your webserver completly unsctructured. Well... in my eyes.
Thanks Matt, I'm using an edited version of your code. But it's still making my whole page white. Anybody know what's up with that?
EDIT: Don't worry about that.
Last edited by loserWILL; 15-07-2008 at 06:58 PM.
What is it you're getting?
Highly insecure do NOT use this. You can transverse other directories using this and get files in those directories that you may not want users to see.
Thats probs the best way to do it. Simply add all your pages to /content/ then save that as index.php and include files by using; index.php?page=filenamewithoutdotphpontheendPHP Code:if ( isset ( $_GET['page'] ) ) {
$file = "content/" . $_GET['page'] . ".php";
if ( file_exists ( $file ) ) {
include ( $file );
}
else {
include ("404.php");
}
}
else {
echo ( "Epic fail: No GET was set." );
}
Want to hide these adverts? Register an account for free!