Hello
I am preparing to setup a request routing system in php based on the $_GET array.
For example, for the url ?r=login
I'd use include myfiles/".$_GET['r'].".php";
Which would point automatically to myfiles/login.php
I know I need to sanitise the get input, but I'm concerned as it is possible to maliciously redirect the include. Can anyone suggest how to prevent this? Also can I check the file actually exists before calling it?
I have some ideas of my own, I just want to know I've not missed any considerations.