vendredi 5 juin 2015

Is this possible with a pageswitch?

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:

http://ift.tt/1Ma6wuk

is it possible to have a pageswitch with an url like this:

http://ift.tt/1cVyp5D

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