Titre: [Résolu] inserer fichier php dans fichier html
Posté par: j3rom3 le le 15-05-2011 a 10:53:45
Bonjour,
je voudrai insérer mon sommaire que j'ai mis dans un fichier php dans mon fichier html je fait donc include mais ça ne marche pas
voici le code du programme principal
<!DOCTYPE html PUBLIC "-//[/sites/details/w3.org W3C]//[/contents/xml/xmldtd.php3 DTD] [/contents/web/weblang.php3 XHTML] 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" lang="fr"> <head> <title></title> <link rel="shortcut icon" href="favicon.ico" /> <meta http-equiv="Content-Type" content="text/html; charset=windows-1252" /> <meta http-equiv="content-language" content="fr" /> <link href="style.css" title="Défaut" rel="stylesheet" type="text/css" media="screen" /> </head> <body>
<[/contents/dhtml/dhtmlintro.php3 div] id="conteneur"><!-- Global --> <div id="header"><!-- Header --> <div id="menu"><!-- Menu -->
[color=Red] <?php include('menu.php'); ?> [/color]
</div><!-- Fin menu --> </div><!-- Fin header --> <div id="contenu"><!-- Contenu --> <div class="contenu_haut"></div><div class="contenu_fond"><!-- Début cadre --> <img src="images/logo.png" style="float:right" alt=""/> <span>Informations générals :</span><br /> Les kits téléchargés ont été réalisés par l'équipe de kitgraphiquegratuit.org. Le site de téléchargement est : <a href="http://www.kitgraphiquegratuit.org" onclick="window.open(this.href); return false;">http://www.kitgraphiquegratuit.org</a>
<br /><br />
<span>Contenu de l'archive :</span><br /> L'archive que vous venez de télécharger contient les fichiers suivants :<br /> - un fichier index.html et un fichier style.css<br /> - un dossier "images" contenant toutes les images du kit<br /> - Le ou les .PSD<br /> - la présente licence
<br /><br />
<span>Termes et conditions de la licence :</span><br /> En téléchargeant et en utilisant ce kit graphique, vous reconnaissez avoir lu et accepté les conditions d'utilisation présente sur notre site : <a href="http://www.kitgraphiquegratuit.org/conditions.php">CGU</a>
<br /><br />
<span>Nous contacter :</span><br /> Pour toutes informations supplémentaires, d'aide, de modification ou de réalisation n'hésitez pas<br /><br /> à nous contacter :<a href="webmaster@kitgraphiquegratuit.org"> E-mail</a><br /> ou à visiter le forum : <a href="http://www.kitgraphiquegratuit.org/forum/">Forum</a> </div><div class="contenu_bas"></div><!-- Fin cadre --> </div><!-- Fin contenu -->
<div id="pied"></div><!-- Pied --> <br /> <!-- mention de copyright Ne pas retirer sans autorisation écrite --> ©<a href="" title=""> Votresite.com</a> 2009 | Design par <a href="http://www.kitgraphiquegratuit.org" onclick="window.open(this.href); return false;" title="kits graphiques">Kitgraphiquegratuit.org</a><br /> <!-- mention de copyright Ne pas retirer sans autorisation écrite --> <span>Partenaires :</span>
<a href="">Partenaires</a> - <a href="">Partenaires</a> - <a href="">Partenaires</a> - <a href="">Partenaires</a> - <a href="">Partenaires</a> - <a href="">Partenaires</a> - <a href="">Partenaires</a> - <a href="">Partenaires</a> - <a href="">Partenaires</a><br /> <span>Liens utiles :</span> <a href="">Accueil</a> - <a href="">Forum</a> - <a href="">Plan du site</a> - <a href="">Contact</a> - <a href="">Qui sommes-nous ?</a> - <a href="">Mentions légales</a><br /> <a href=""><img src="images/bouton.jpg" style="margin:3px 0 0 0" alt=""/></a> <a href=""><img src="images/bouton.jpg" style="margin:3px 0 0 0" alt=""/></a> <a href=""><img src="images/bouton.jpg" style="margin:3px 0 0 0" alt=""/></a> <a href=""><img src="images/bouton.jpg" style="margin:3px 0 0 0" alt=""/></a> <a href=""><img src="images/bouton.jpg" style="margin:3px 0 0 0" alt=""/></a> <a href=""><img src="images/bouton.jpg" style="margin:3px 0 0 0" alt=""/></a> <a href=""><img src="images/bouton.jpg" style="margin:3px 0 0 0" alt=""/></a> </div><!-- Fin Global -->
</body> </html>
voici de code de menu.php
<div id="left"> <ul> <li ><a href="index.html" title="">- Accueil</a></li> <li ><a href="" title="">- Rubrique</a></li> <li ><a href="" title="">- Rubrique</a></li> <li ><a href="" title="">- Rubrique</a></li> <li ><a href="" title="">- Rubrique</a></li> <li ><a href="" title="">- Rubrique</a></li> <li ><a href="" title="">- Rubrique</a></li> <li ><a href="" title="">- Rubrique</a></li> <li ><a href="" title="">- Rubrique</a></li> <li ><a href="" title="">- Rubrique</a></li> </ul> </div>
Merci d'avance
|
Titre: Re:inserer fichier php dans fichier html
Posté par: Wolf18 le le 15-05-2011 a 13:57:08
Bonjour, normal que cela ne fonctionne pas dans l'état actuel. Pour insérer du code PHP sur une page Web celle-ci doit impérativement être au format adéquat, autrement dit, tu dois changer l'extension de ta page .html (ou .htm) en .php.
Et là ça marchera ;) |
Titre: Re:inserer fichier php dans fichier html
Posté par: j3rom3 le le 15-05-2011 a 14:03:31
| merci pour ton aide met même en renommant en index .php, ça ne marche pas |
Titre: Re:inserer fichier php dans fichier html
Posté par: j3rom3 le le 15-05-2011 a 14:08:54
| peut-être parce que menu.php est écrit en html non ? |
Titre: Re:inserer fichier php dans fichier html
Posté par: Wolf18 le le 15-05-2011 a 14:19:15
Non que le contenu de ta page menu.php soit du HTML ne pose aucun problème.
Tu fais ton test en local ou directement chez ton hébergeur en ligne ? |
Titre: Re:inserer fichier php dans fichier html
Posté par: j3rom3 le le 15-05-2011 a 14:26:03
Titre: Re:inserer fichier php dans fichier html
Posté par: j3rom3 le le 15-05-2011 a 14:32:22
| CA marche en le mettant en ligne ;D Merci pour ton aide |
Titre: Re:inserer fichier php dans fichier html
Posté par: Wolf18 le le 15-05-2011 a 14:35:35
| Si tu veux utiliser php en local tu dois posséder un logiciel qui simulera un serveur Web apache... Dans le genre tu as EasyPHP ou Wamp, ils sont gratuits. |
Titre: Re:inserer fichier php dans fichier html
Posté par: j3rom3 le le 15-05-2011 a 14:40:29
Forum-webmaster | Actionné par YaBB SE
© 2001-2003, YaBB SE Dev Team. Tous droits réservés.
|