par
Cyrano » 06 avr. 2006, 19:34
Si je saisis bien ce que tu fais, tu inclus une page dans ton tableau: le problème, c'est que c'est une page complète, incluant l'en-tête html et le pied de page html également. À l'intérieur d'une page, tu ne peux inclure que du contenu, pas "l'emballage".
J'ajouterais que pour te faciliter la vie, tu pourrais aligner un peu ton code, tout éparpiller un peu au hasard, ça ne facilite pas le débuggage :
<?php
session_start();
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>index</title>
<style type="text/css">
p {
padding: 15px;
}
<!--
body {
background-image: url(images/arriere_plan.jpg);
}
a:link {
text-decoration: none;
color: #000000;
}
a:visited {
text-decoration: none;
}
a:hover {
text-decoration: none;
}
a:active {
text-decoration: none;
}
.Style2 {
font-size: 24px;
font-weight: bold;
}
.Style3 {
font-weight: bold
}
.Style5 {
font-size: 18px;
font-weight: bold;
}
.Style6 {
color: #000000;
font-weight: bold;
}
</style>
<!-- keywords: culture telechargement illegal warez hack hacker brico bricolage reveil numericque -->
<TITLE>Culture-G</TITLE>
<META HTTP-EQUIV="REFRESH" CONTENT="300">
</head>
<body>
<table width="100%" valign="top" height="100%" border="1" cellpadding="0" cellspacing="0">
<tr>
<th width="15%" height="102">logo</th>
<th width="84%" height="102">
<strong><a href="/index.php?page=connexion">Se connecter</a></strong><br>
</tr>
<tr>
<td height="50%" valign="top">
<center>menu<br>
</center>
</td>
<td height="50%">
<?php
// On définit le tableau contenant les pages autorisées
// ----------------------------------------------------
$pageOK = array('inscription' => 'inscription.php',
'fiches' => 'fiches.php',
'news' => 'news.php',
'membres' => 'membres.php',
'connexion' => 'connexion.php',
'deconnecter' => 'deconnecter.php',
'espace_membres' => 'espace_membres.php',
'delete' => 'delete.php',
'ajout' => 'ajout.php',
'type' => 'type.php',
'fiche' => 'fiche.php',
'tune' => 'tune.php',
'partenaires' => 'partenaires.php',
'contact' => 'contact.php',
'modif' => 'modif.php',
'supprimer' => 'supprimer.php');
// On teste que le paramètre d'url existe et qu'il est bien autorisé
// -----------------------------------------------------------------
if ( (isset($_GET['page'])) && (isset($pageOK[$_GET['page']])) )
{
include($pageOK[$_GET['page']]); // Nous appelons le contenu central de la page
}
else
{
// Page par défaut quant elle n'existe pas dans le tableau
require('news.php');
}
?>
</td>
</tr>
<tr>
<td height="50" colspan="2"><div align="center" class="Style1"></div></td>
</tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<th scope="col"><p>
</th>
</tr>
</table>
</body>
</html>
Pas plus facile à lire comme ça ? 8)
Si je saisis bien ce que tu fais, tu inclus une page dans ton tableau: le problème, c'est que c'est une page complète, incluant l'en-tête html et le pied de page html également. À l'intérieur d'une page, tu ne peux inclure que du contenu, pas "l'emballage".
J'ajouterais que pour te faciliter la vie, tu pourrais aligner un peu ton code, tout éparpiller un peu au hasard, ça ne facilite pas le débuggage :
[php]<?php
session_start();
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>index</title>
<style type="text/css">
p {
padding: 15px;
}
<!--
body {
background-image: url(images/arriere_plan.jpg);
}
a:link {
text-decoration: none;
color: #000000;
}
a:visited {
text-decoration: none;
}
a:hover {
text-decoration: none;
}
a:active {
text-decoration: none;
}
.Style2 {
font-size: 24px;
font-weight: bold;
}
.Style3 {
font-weight: bold
}
.Style5 {
font-size: 18px;
font-weight: bold;
}
.Style6 {
color: #000000;
font-weight: bold;
}
</style>
<!-- keywords: culture telechargement illegal warez hack hacker brico bricolage reveil numericque -->
<TITLE>Culture-G</TITLE>
<META HTTP-EQUIV="REFRESH" CONTENT="300">
</head>
<body>
<table width="100%" valign="top" height="100%" border="1" cellpadding="0" cellspacing="0">
<tr>
<th width="15%" height="102">logo</th>
<th width="84%" height="102">
<strong><a href="/index.php?page=connexion">Se connecter</a></strong><br>
</tr>
<tr>
<td height="50%" valign="top">
<center>menu<br>
</center>
</td>
<td height="50%">
<?php
// On définit le tableau contenant les pages autorisées
// ----------------------------------------------------
$pageOK = array('inscription' => 'inscription.php',
'fiches' => 'fiches.php',
'news' => 'news.php',
'membres' => 'membres.php',
'connexion' => 'connexion.php',
'deconnecter' => 'deconnecter.php',
'espace_membres' => 'espace_membres.php',
'delete' => 'delete.php',
'ajout' => 'ajout.php',
'type' => 'type.php',
'fiche' => 'fiche.php',
'tune' => 'tune.php',
'partenaires' => 'partenaires.php',
'contact' => 'contact.php',
'modif' => 'modif.php',
'supprimer' => 'supprimer.php');
// On teste que le paramètre d'url existe et qu'il est bien autorisé
// -----------------------------------------------------------------
if ( (isset($_GET['page'])) && (isset($pageOK[$_GET['page']])) )
{
include($pageOK[$_GET['page']]); // Nous appelons le contenu central de la page
}
else
{
// Page par défaut quant elle n'existe pas dans le tableau
require('news.php');
}
?>
</td>
</tr>
<tr>
<td height="50" colspan="2"><div align="center" class="Style1"></div></td>
</tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<th scope="col"><p>
</th>
</tr>
</table>
</body>
</html>[/php]
Pas plus facile à lire comme ça ? 8)