index get var include

DCTAZ

New Member
im making a small siteAnd Instead of having a header.php and a footer.php with neccesarry info (functions,dbconnection, html head) and include on every page I'd like to have it all in index.php. But then I have to add pages to an whitelist and all this. I'd just like to be able to drop it in pages/ and then access it with index.php?page=testHow would I include pages without having to make a big whitelist? How about using preg_match and checcking that page variable only contain a-z. no evil dots. if it only contain letter a-z > include?or maybe use glob and scan pages/, add them to array so i dont have to edit index.php every timeplease tell me your thoughts and ideas\[code\]<html><head><title>SindACC</title></head><body><?php include($page) ?></body></html>\[/code\]
 
Back
Top