PHP Classes

File: index.php

Recommend this page to a friend!
  Classes of Andi Trînculescu   Navigation   index.php   Download  
File: index.php
Role: Example script
Content type: text/plain
Description: example file
Class: Navigation
Site navigation bar generation
Author: By
Last change:
Date: 20 years ago
Size: 907 bytes
 

Contents

Class file image Download
<?php
include_once('config.php');

$p = (int)$_GET['p'];
if (empty(
$p) || !is_int($p) || ($p <= 0)) {
   
$p = 1;
}

$nav->setLevel($p - 1);
$nav->push("?p=$p", "page $p");
?>
<html>
<head>
    <title>Page <?= $p ?></title>
    <link rel="stylesheet" href="style.css" type="text/css">
</head>
<body>
    <p><?= $nav->html() ?></p>
    <p>&nbsp;</p>
    <p><?= "Content $p Content $p Content $p Content $p Content $p Content $p Content $p Content $p Content $p" ?></p>
    <p><?= "Content $p Content $p Content $p Content $p Content $p Content $p Content $p Content $p Content $p" ?></p>
    <p><?= "Content $p Content $p Content $p Content $p Content $p Content $p Content $p Content $p Content $p" ?></p>
    <p><?= "Content $p Content $p Content $p Content $p Content $p Content $p Content $p Content $p Content $p" ?></p>
    <p>&nbsp;</p>
    <p><a href="?p=<?= $p + 1 ?>">[next]</a>
</body>
</html>