|
|
|
|
Bonjour,
Question bête, mais c'est important : j'ai une page index.php qui contient en fait tout mon site (index.php?page="nom_de_la_page)
Comment faire pour que "/" pointe vers la vrai page d'accueil (c'est à dire index.php?page=accueil) ?
Faut-il traffiquer le .htaccess (sachant que je suis chez Free, c'est pas génial...) ou modifier index.php (et lui dire que quand il n'y a pas de variable "page", elle appelle la pseudo-frame de la page d'accueil (c'est à dire accueil.php) ?
Merci
J'utilise des if :
<?php
if ($_GET['page'] == "accueil")
{
echo "<a href=\"/\">Spider's Web</a> / ";
}
if ($_GET['page'] == "prestations")
{
echo "<a href=\"/\">Spider's Web</a> / <a href=index.php?page=prestations>Prestations</a> / "; }
if ($_GET['page'] == "realisations")
{
echo "<a href=\"/\">Spider's Web</a> / <a href=index.php?page=realisations>Réalisations</a> / "; }
if ($_GET['page'] == "tarifs")
{
echo "<a href=\"/\">Spider's Web</a> / <a href=index.php?page=tarifs>Tarifs</a> / "; }
if ($_GET['page'] == "contact")
{
echo "<a href=\"/\">Spider's Web</a> / <a href=index.php?page=contact>Contact</a> / "; }
if ($_GET['page'] == "sitemap")
{
echo "<a href=\"/\">Spider's Web</a> / <a href=index.php?page=sitemap>Plan du site</a> / "; }
if ($_GET['page'] == "apropos")
{
echo "<a href=\"/\">Spider's Web</a> / <a href=index.php?page=apropos>À propos</a> / ";
}
?>
C'est vrai c'est bizarre j'y ai pas pensé mais c'était comme ça sur le Site du Zér0, bizarre... Donc quel est le code pour le switch STP ? Merci |
<?php
switch ($_GET['page']):
case accueil:
echo "<a href=\"/\">Spider's Web</a> / ";
break;
case prestation:
echo "<a href=\"/\">Spider's Web</a> / <a href=index.php?page=prestations>Prestations</a> / ";
break;
case realisations:
echo "<a href=\"/\">Spider's Web</a> / <a href=index.php?page=realisations>Réalisations</a> / ";
break;
[ETC...]
default:
echo "<a href=\"/\">Spider's Web</a> / ";
endswitch;
?>
Voila je n'ai pas tout fait a toi de terminé .... suffit de copier/coller et de changer les valeurs . - [ Juck'n0 ]- |