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.
Printable View
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." );
}
I highly disagree with you on that method. Seems like a lazy way and makes your webserver completly unsctructured. Well... in my eyes.
Not if your doing it from a database...
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.
What is it you're getting?