[PHP ?]Contenu fichier html dans une page web
parisiendu95360
Messages postés
23
Statut
Membre
-
Utilisateur anonyme -
Utilisateur anonyme -
Bonjour,
Voilà je suis en train de refaire mon site et je voulais avoir quelques indications !
J'ai, dans un fichier "menu.html", uniquement un tableau : pas de balises "head", "body", "html" ...
et ce tableau c'est donc mon menu.
Ce que je souhaite c'est que ce tableau s'affiche dans un autre tableau de ma page d'accueil pour respecter une certaine mise en page.
Après quelques recherches, je me tourne vers le PHP. Est-ce une bonne idée ?
J'ai essayé les frames mais ça redimensionne tout et les liens de mon menu s'ouvrent dans le frame.
Comment faire ?
Voilà le code de la page "menu.html" :
<table class="menu_table" width="100%" cellpadding="5px" bgcolor="#CCCCCC">
<tr>
<td width="10%" bgcolor="CCCCCC"></td>
<td width="90%" align="left" onmouseover="this.style.color='white';this.style.background='#000000'" onmouseout="this.style.color='black';this.style.background='#CCCCCC'" onclick="location.href='index.html';">Accueil</td>
</tr>
<tr>
<td width="10%" bgcolor="CCCCCC"></td>
<td width="90%" align="left" onmouseover="this.style.color='white';this.style.background='#000000'" onmouseout="this.style.color='black';this.style.background='#CCCCCC'" onclick="location.href='news.html';">Actualités</a></td>
</tr>
<tr>
<td width="10%" bgcolor="000000"></td>
<td width="90%" align="center" class="menu_table_sous_liste" onmouseover="this.style.color='white';this.style.background='#000000'" onmouseout="this.style.color='black';this.style.background='#CCCCCC'" onclick="location.href='news/acc_informatique.html';">Informatique</a></td>
</tr>
<tr>
<td width="10%" bgcolor="000000"></td>
<td width="90%" align="center" class="menu_table_sous_liste" onmouseover="this.style.color='white';this.style.background='#000000'" onmouseout="this.style.color='black';this.style.background='#CCCCCC'" onclick="location.href='news/acc_materiel.html';">Matériel</a></td>
</tr>
<tr>
<td width="10%" bgcolor="000000"></td>
<td width="90%" align="center" class="menu_table_sous_liste" onmouseover="this.style.color='white';this.style.background='#000000'" onmouseout="this.style.color='black';this.style.background='#CCCCCC'" onclick="location.href='news/acc_jeux_videos.html';">Jeux Vidéos</a></td>
</tr>
<tr>
<td width="10%" bgcolor="CCCCCC"></td>
<td width="90%" align="left" onmouseover="this.style.color='white';this.style.background='#000000'" onmouseout="this.style.color='black';this.style.background='#CCCCCC'" onclick="location.href='astuces.html';">Astuces</a></td>
</tr>
<tr>
<td width="10%" bgcolor="000000"></td>
<td width="90%" align="center" class="menu_table_sous_liste" onmouseover="this.style.color='white';this.style.background='#000000'" onmouseout="this.style.color='black';this.style.background='#CCCCCC'" onclick="location.href='astuces/acc_Windows.html';">Windows</a></td>
</tr>
<tr>
<td width="10%" bgcolor="000000"></td>
<td width="90%" align="center" class="menu_table_sous_liste" onmouseover="this.style.color='white';this.style.background='#000000'" onmouseout="this.style.color='black';this.style.background='#CCCCCC'" onclick="location.href='astuces/acc_MacOS.html';">Mac OS</a></td>
</tr>
<tr>
<td width="10%" bgcolor="000000"></td>
<td width="90%" align="center" class="menu_table_sous_liste" onmouseover="this.style.color='white';this.style.background='#000000'" onmouseout="this.style.color='black';this.style.background='#CCCCCC'" onclick="location.href='astuces/acc_LinuxUnix.html';">Linux/Unix</a></td>
</tr>
<tr>
<td width="10%" bgcolor="CCCCCC"></td>
<td width="90%" align="left" onmouseover="this.style.color='white';this.style.background='#000000'" onmouseout="this.style.color='black';this.style.background='#CCCCCC'" onclick="location.href='forum.html';">Forum</a></td>
</tr>
</table>
Et le code de la page "index.php" :
<html>
<head>
<title>
titre
</title>
<link href="css/style.css" type="text/css" rel="stylesheet" media="screen"/>
</head>
<body>
<div align="center">
<table width="100%" align="center" border="0" cellspacing="5px">
<tr>
<td>
<table width="100%" border="0" cellspacing="5px">
<tr valign="top">
<td width="15%">
<div class="menu">
<?php $handle = fopen("/menu.html", "r"); ?>
</div>
</td>
<td width="75%">
</td>
<td width="10%">
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td>
</td>
</tr>
</table>
</div>
</body>
</html>
Merci de votre aide !
Voilà je suis en train de refaire mon site et je voulais avoir quelques indications !
J'ai, dans un fichier "menu.html", uniquement un tableau : pas de balises "head", "body", "html" ...
et ce tableau c'est donc mon menu.
Ce que je souhaite c'est que ce tableau s'affiche dans un autre tableau de ma page d'accueil pour respecter une certaine mise en page.
Après quelques recherches, je me tourne vers le PHP. Est-ce une bonne idée ?
J'ai essayé les frames mais ça redimensionne tout et les liens de mon menu s'ouvrent dans le frame.
Comment faire ?
Voilà le code de la page "menu.html" :
<table class="menu_table" width="100%" cellpadding="5px" bgcolor="#CCCCCC">
<tr>
<td width="10%" bgcolor="CCCCCC"></td>
<td width="90%" align="left" onmouseover="this.style.color='white';this.style.background='#000000'" onmouseout="this.style.color='black';this.style.background='#CCCCCC'" onclick="location.href='index.html';">Accueil</td>
</tr>
<tr>
<td width="10%" bgcolor="CCCCCC"></td>
<td width="90%" align="left" onmouseover="this.style.color='white';this.style.background='#000000'" onmouseout="this.style.color='black';this.style.background='#CCCCCC'" onclick="location.href='news.html';">Actualités</a></td>
</tr>
<tr>
<td width="10%" bgcolor="000000"></td>
<td width="90%" align="center" class="menu_table_sous_liste" onmouseover="this.style.color='white';this.style.background='#000000'" onmouseout="this.style.color='black';this.style.background='#CCCCCC'" onclick="location.href='news/acc_informatique.html';">Informatique</a></td>
</tr>
<tr>
<td width="10%" bgcolor="000000"></td>
<td width="90%" align="center" class="menu_table_sous_liste" onmouseover="this.style.color='white';this.style.background='#000000'" onmouseout="this.style.color='black';this.style.background='#CCCCCC'" onclick="location.href='news/acc_materiel.html';">Matériel</a></td>
</tr>
<tr>
<td width="10%" bgcolor="000000"></td>
<td width="90%" align="center" class="menu_table_sous_liste" onmouseover="this.style.color='white';this.style.background='#000000'" onmouseout="this.style.color='black';this.style.background='#CCCCCC'" onclick="location.href='news/acc_jeux_videos.html';">Jeux Vidéos</a></td>
</tr>
<tr>
<td width="10%" bgcolor="CCCCCC"></td>
<td width="90%" align="left" onmouseover="this.style.color='white';this.style.background='#000000'" onmouseout="this.style.color='black';this.style.background='#CCCCCC'" onclick="location.href='astuces.html';">Astuces</a></td>
</tr>
<tr>
<td width="10%" bgcolor="000000"></td>
<td width="90%" align="center" class="menu_table_sous_liste" onmouseover="this.style.color='white';this.style.background='#000000'" onmouseout="this.style.color='black';this.style.background='#CCCCCC'" onclick="location.href='astuces/acc_Windows.html';">Windows</a></td>
</tr>
<tr>
<td width="10%" bgcolor="000000"></td>
<td width="90%" align="center" class="menu_table_sous_liste" onmouseover="this.style.color='white';this.style.background='#000000'" onmouseout="this.style.color='black';this.style.background='#CCCCCC'" onclick="location.href='astuces/acc_MacOS.html';">Mac OS</a></td>
</tr>
<tr>
<td width="10%" bgcolor="000000"></td>
<td width="90%" align="center" class="menu_table_sous_liste" onmouseover="this.style.color='white';this.style.background='#000000'" onmouseout="this.style.color='black';this.style.background='#CCCCCC'" onclick="location.href='astuces/acc_LinuxUnix.html';">Linux/Unix</a></td>
</tr>
<tr>
<td width="10%" bgcolor="CCCCCC"></td>
<td width="90%" align="left" onmouseover="this.style.color='white';this.style.background='#000000'" onmouseout="this.style.color='black';this.style.background='#CCCCCC'" onclick="location.href='forum.html';">Forum</a></td>
</tr>
</table>
Et le code de la page "index.php" :
<html>
<head>
<title>
titre
</title>
<link href="css/style.css" type="text/css" rel="stylesheet" media="screen"/>
</head>
<body>
<div align="center">
<table width="100%" align="center" border="0" cellspacing="5px">
<tr>
<td>
<table width="100%" border="0" cellspacing="5px">
<tr valign="top">
<td width="15%">
<div class="menu">
<?php $handle = fopen("/menu.html", "r"); ?>
</div>
</td>
<td width="75%">
</td>
<td width="10%">
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td>
</td>
</tr>
</table>
</div>
</body>
</html>
Merci de votre aide !
A voir également:
- [PHP ?]Contenu fichier html dans une page web
- Fichier bin - Guide
- Fichier epub - Guide
- Supprimer une page dans word - Guide
- Fichier rar - Guide
- Comment réduire la taille d'un fichier - Guide