Ok here's my code
$ref = $_GET['ref'];
if (file_exists('views/'.$ref.'.php')) {
$this->prepare($ref);
}
elseif (!file_exists('views/'.$ref.'.php')) {
echo 'Page you are requesting doesn´t exist';
}
I'm currently having issues if users try to do ?ref=con or ?ref=com1 etc, file_exists will always return true. Is there a work around for this?