Pag d'accueil en PHP avec pseudo-frames

Résolu/Fermé
Mysterious_fea Messages postés 401 Date d'inscription vendredi 29 juin 2007 Statut Membre Dernière intervention 23 mars 2013 - 5 déc. 2007 à 19:02
Mysterious_fea Messages postés 401 Date d'inscription vendredi 29 juin 2007 Statut Membre Dernière intervention 23 mars 2013 - 5 déc. 2007 à 21:17
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
A voir également:

4 réponses

naruto-94 Messages postés 865 Date d'inscription mercredi 17 août 2005 Statut Membre Dernière intervention 20 décembre 2012 188
5 déc. 2007 à 20:27
<?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&eacute;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 .
2
naruto-94 Messages postés 865 Date d'inscription mercredi 17 août 2005 Statut Membre Dernière intervention 20 décembre 2012 188
5 déc. 2007 à 19:53
Salut,

Ben j'en deduis que tu utilise un switch donc tu dois mettre une valeur par defaut . si tu utilise des if change sa tout de suite !

default:
    include('accueil.php');
endswitch;

0
Mysterious_fea Messages postés 401 Date d'inscription vendredi 29 juin 2007 Statut Membre Dernière intervention 23 mars 2013 35
5 déc. 2007 à 20:09
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&eacute;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>&Agrave; 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
0
Mysterious_fea Messages postés 401 Date d'inscription vendredi 29 juin 2007 Statut Membre Dernière intervention 23 mars 2013 35
5 déc. 2007 à 21:17
Merci beaucoup, c'est parfait !
A+
0