Chapitre
3 - Les principales fonctions
3) La fonction
include ou semblant de frame
La fonction include permet d'insérer à
tout endroit d'une page PHP, le contenu d'un fichier autant de fois
qu'on l'appelle.
Pour inclure un fichier avec include on procède
comme ceci:
<?
include("fichier.html");
?>
Exemple :
Ajouter des pages/fichiers sur votre page index.php
sans avoir à créer des frames
<html>
<head>
<title>index.php</title>
</head>
<table border="0"
width="750" align="center">
<tr><td width="150"
valign="top">
<? include('menu.php');
?> //Votre
menu
</td><td width="600"
valign="top">
<? include('centre.php');
?> //Page centrale
</td></tr></table>
</html>
|