demonlord 0 Report post Posted January 2, 2008 hi i'm not that great at php so i'm not to sure if this will work or not. but what i want to do is be able to use ?p=staff or what ever page name, with out the php extion, and i would like to no if this simple script i made would work.the code is: <?php $p = $_GET['p'];if ( !empty($p) && file_exists('./' . $p . '.php') && stristr( $p, '.' ) == False ) {// pages = directory where you store your pages $file = './' . $p . '.php';}else{// 1.php = defult page $file = './index.php';}include $file;?> if there is something wrong with this please let me know Share this post Link to post Share on other sites
shadowx 0 Report post Posted January 2, 2008 It should work fine. I made a little system in a very similar way and it worked fine. Its also good as its simplicity will eliminate a lot of security risks. Systems like this that use DBs have the added risk of SQL injections etc so this method will be a lot more secure.Now you can develop the code more and perhaps make a whole CMS out of it! Good work Share this post Link to post Share on other sites
demonlord 0 Report post Posted January 2, 2008 thanks. what is CMS? Share this post Link to post Share on other sites
jlhaslip 4 Report post Posted January 3, 2008 Content Management System, like Joomla or Mambo.What they are trying to say is: keep coding and you will get better... Share this post Link to post Share on other sites
demonlord 0 Report post Posted January 3, 2008 ok thanks, i've used Joomla before but i did not know that it was a cms. Share this post Link to post Share on other sites
gogoily 0 Report post Posted January 10, 2008 If those codes are in the "index.php" file, it will work. Share this post Link to post Share on other sites