Pagination en PHP

From Tuxunix
Jump to: navigation, search
   1.<?php
   2.       
   3./*
   4. * Fonction de pagination
   5. * @param char GET page
   6.*/
   7.function page_select(){
   8.    if(isset($_GET[page]) && !empty($_GET[page])){
   9.        switch($_GET[page]){
  10.            case "accueil" :
  11.                $page = require_once("accueil.html"); ; break;
  12.            case "contact" :
  13.                $page = require_once("contact.php"); break;
  14.            case "ast" :
  15.                $page = require_once("astuces.php"); break;
  16.            default :
  17.                $page = require_once("accueil.html"); ; break;
  18.        }
  19.    }
  20.    else
  21.    {
  22.        $page = require_once("accueil.html");
  23.    }
  24.       
  25.    // return $page ;
  26.}//End page_select
  27.       
  28.?>


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<4/element/html.html">html xmlns="http://www.w3.org/1999/xhtml">
<4/element/head.html">head>
<4/element/meta.html">meta name="generator" content="HTML Tidy, see www.w3.org" />
<4/element/title.html">title>TuXedo</4/element/title.html">title>
<4/element/meta.html">meta http-equiv="Content-Type" content=
"text/html; charset=utf-8" />
<4/element/link.html">link type="text/css" rel="stylesheet" href="tuxedo.css" media=
"screen" />
</4/element/head.html">head>
<4/element/body.html">body>
 
<4/element/div.html">div id="contents">
	<4/element/fieldset.html">fieldset class="fieldset">
<?php echo page_select(); ?>