× This is an archived version of my website. Please go to https://lprp.fr for current version.
Francais English
Menu > Divers / Programmation / Web / This site

Technical information about this site

My goal was to learn PHP.

Appearances / Navigation

This site can have several looks. It is absolutely useless, but it allows to keep old designs...

Here are all the possible looks :

In addition to that, several navigation bars are available :

As the left layout is not very good, and regarding some opinions, the 'top' and 'mixed' navigation are privilegied.

The principle

The principle is very simple and relies on four files :

The top of the text file contains :
<? // Template Top definitions
$docRoot=""; while (!file_exists($docRoot . "ROOT")) { $docRoot = $docRoot . "../"; }
include ($docRoot . "config.php3");
include ($docRoot . "header.php3");
// ------------------------------------------------------------------------
?>

The difficulty with this manner, is to know where are stored the configuration files, as this text file can be in any subfolder.
The first line seeks the ROOT file, created in the "root" folder of the site. By finding that information, the file is able to address all the other files with relatives addresses with $docRoot.
Then the configuration file and the header are included.

The end is easier :
<?
// ------------------------------------------------------------------------
// Template Bottom definitions
include ($docRoot . "footer.php3")
?>

The configuration file contains a huge array containing all the information relative to the pages to be included in the menu, and some other information, as the name of the image files... To include a file, you just have to change this configuration file, and all pages will be generated with the changes.

A little more

I wanted to have different looks for my site, like "skins". I created so different header and footer files for each, and created several parts :

To test these looks, try "?menu=[name of the look]". Three links are displayed below "Index". Then a cookie is set, with a duration of 30 minutes. Three "looks" are available :

A "smart" selection between French / English page is also done.


Valid CSS! Haut de Page / Top of the page [ Mini Lien ]   [ Nav ]   [ Menu ]   [ Mirrors ] © 2000-2024 Rémi Peyronnet. /prog/site_en.php3. (08/12/2018)