dslreports logo
site
 
    All Forums Hot Topics Gallery
spc

spacer




how-to block ads


Search Topic:
share rss forum feed


cdru
Go Colts
Premium,MVM
join:2003-05-14
Fort Wayne, IN
kudos:7
reply to Ashke

Re: Please help me make something like site.com/?p=pagetwo

Don't worry about generating the menu. The sanitizing of the input there doesn't really matter as you aren't loading scripts/resources based on the query string.

The use of basename() in line 20 of your index page prevents directory traversal. It still would allow for other php to be called though even though you may not want them to be. I'd put all your content pages in a subdirectory (e.g. "pages") and only have content pages there. So change line 20 to
$page = "pages\".basename($page); 
 


Ashke
Flips page and continues reading
Premium
join:2007-09-11
Minneapolis, MN
Awesome! Thanks for helping out!

Sorry it took me a while to respond. I've been swamped with work and other stuff, including web dev.
--
-Ashke