Usually i would use url parameters for a pageswitch,
lets say i got this switch so p is the page
if(isset($_GET['p']){
$page = $_GET['p'];
if(file_exists('includes/' . $page . '.php')){
// include the page
} else {
// include error page
}
} else {
// include homepage
}
my url would look like this:
is it possible to have a pageswitch with an url like this:
mention the missing .php at the end of the url.
and can someone tell me if this php if else statement is a proper way to include files ?
Aucun commentaire:
Enregistrer un commentaire