PHP Classes

File: url_rewrite/index.php

Recommend this page to a friend!
  Classes of adeniyi ibraheem   URL Rewriting in PHP   url_rewrite/index.php   Download  
File: url_rewrite/index.php
Role: Application script
Content type: text/plain
Description: index page
Class: URL Rewriting in PHP
Extract request parameters from URL
Author: By
Last change:
Date: 11 years ago
Size: 493 bytes
 

Contents

Class file image Download
<?php
include 'simpleurl.php';
$page = "";
$url = new SimpleUrl('/url_rewrite/');
if(
$url->segment(1) == FALSE)
{
   
$page = 'home';
}
else
{
   
$page = $url->segment(1);
}

switch(
$page)
{
    case
"home":
        include
'page/home.php';
    break;
    case
"product":
        include
'page/product.php';
    break;
    case
"about_us":
        include
'page/about.php';
    break;
    case
"contact":
        include
'page/contact.php';
    break;
    default:
        echo
"404 ERROR... Page not found";
    break;
}

?>