Bonsoir, J'ai suivi ce tutoriel "[url=http://www.grafikart.fr/tutoriels/php/decomposer-site-php-102]\*\*Décomposer un site en PHP avec obStart**[/url]" tout marche niquel, mais quelques trucs me chagrine. L'admin à mis une page 404 pour toutes les erreurs que d'url, ils seront donc redirigés sur cette page ci. On est bien d'accord. La page 404 en css fonctionne parfaitement. Exemple : **localhost/mon_dossier/blabla** **blabla** n'existe pas donc il m’affiche la page 404. Mais par contre si on va par exemple sur cette page *(qui sur cette exemple ci-dessous n'existera pas non plus)* Exemple : **localhost/mon_dossier/second_dossier/blabla2** **blabla2** n'existe pas donc il m'affiche la page 404, [u]mais[/u] le css ne s'affiche pas, car il fonctionne uniquement pour le mon_dossier. **Question** : Comment rendre accessible le fichier css à toutes les pages sur n'importe quel URL. Cordialement, Tchoupi.
Index.php
<?php
define("WEBROOT","/mon_site/");
if(!isset($_GET"p"])){ $_GET"p"]="index"; }
if(!file_exists("pages/".$_GET"p"].".php")){ $_GET"p"]="404"; }
ob_start();
include "pages/".$_GET"p"].".php";
$pages = ob_get_contents();
ob_end_clean();
include "template.php";
?>
template.php
<?xml version="1.0" encoding="utf-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" lang="fr">
<head>
<?php if(isset($head)): ?>
<?php echo $head; ?>
<?php else: ?>
<title>mon_site</title>
<?php endif; ?>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="theme/css/common.css" type="text/css"/>
<script type="text/javascript" src="theme/js/jquery.js"></script>
<script type="text/javascript" src="theme/js/nav.js"></script>
<script type="text/javascript" src="theme/js/nivo.js"></script>
<script type="text/javascript">
$(window).load(function() {
$('#slider').nivoSlider();
});
</script>
<!--[if lte IE 8]><script type="text/javascript" src="theme/js/roundies.js"></script><![endif]-->
<script type="text/javascript" src="theme/js/validInscription.js"></script>
<script type="text/javascript" src="theme/js/yuiloader-min.js"></script>
<script type="text/javascript" src="theme/js/yahoo-dom-event.js"></script>
<script type="text/javascript" src="theme/js/dragdrop-min.js"></script>
<script type="text/javascript" src="theme/js/pages_persos-includes.js"></script>
<script type="text/javascript" src="theme/js/jsport.js"></script>
<script type="text/javascript">
jQuery(function($){
$('a.zoombox').zoombox({
width : 700,
height : 520,
theme : 'nw',
});
});
</script>
<script src="jquery-css-transform.js"></script>
<script src="jquery-animate-css-rotate-scale.js"></script>
<script>
function bbcode(bbdebut, bbfin)
{
var input = window.document.formulaire.message;
input.focus();
if(typeof document.selection != 'undefined')
{
var range = document.selection.createRange();
var insText = range.text;
range.text = bbdebut + insText + bbfin;
range = document.selection.createRange();
if (insText.length == 0)
{
range.move('character', -bbfin.length);
}
else
{
range.moveStart('character', bbdebut.length + insText.length + bbfin.length);
}
range.select();
}
else if(typeof input.selectionStart != 'undefined')
{
var start = input.selectionStart;
var end = input.selectionEnd;
var insText = input.value.substring(start, end);
input.value = input.value.substr(0, start) + bbdebut + insText + bbfin + input.value.substr(end);
var pos;
if (insText.length == 0)
{
pos = start + bbdebut.length;
}
else
{
pos = start + bbdebut.length + insText.length + bbfin.length;
}
input.selectionStart = pos;
input.selectionEnd = pos;
}
else
{
var pos;
var re = new RegExp('^[0-9]{0,3}$');
while(!re.test(pos))
{
pos = prompt("insertion (0.." + input.value.length + "):", "0");
}
if(pos > input.value.length)
{
pos = input.value.length;
}
var insText = prompt("Veuillez taper le texte");
input.value = input.value.substr(0, pos) + bbdebut + insText + bbfin + input.value.substr(pos);
}
}
function smilies(img)
{
window.document.formulaire.message.value += '' + img + '';
}
</script>
</head><div id="header">
</div><body><script type="text/javascript">
//<![CDATA[
try{(function(a){var b="http://",c="www.google.com",d="/cdn-cgi/cl/",e="28379433787a35a2b8ec7d75207107fbc3f2fd7f.gif",f=new a;f.src=[b,c,d,e].join("")})(Image)}catch(e){}
//]]>
</script><div id="mainDiv"><div id="top">
<div class="info_1">? Serveur : <img src="theme/img/devtool/ok.png" style="vertical-align:-20%;"/> <font color="#4c973d"><b>En Ligne</b></font> </div>
<div class="info_2">? Comptes : <b>282</b></div>
<div class="info_3">? Connectés : <b>0</b></div>
<a href="?p=rejoindre" id="button_play"> </a>
</div><div id="menu">
<div id="content">
<a id="button2" href="<?php echo WEBROOT; ?>vote"></a>
<ul>
<img src="theme/img/global/topUL.png"/>
<li><a href="<?php echo WEBROOT; ?>home">? Accueil</a></li>
<li><a href="<?php echo WEBROOT; ?>rejoindre">? Nous rejoindre</a></li>
<li><a href="<?php echo WEBROOT; ?>classement">? Classements</a></li>
<li><a href="<?php echo WEBROOT; ?>equipe">? L'équipe</a></li>
<li><a href="<?php echo WEBROOT; ?>armurerie">? Armurerie</a></li>
<li><a href="<?php echo WEBROOT; ?>boutique">? Boutique</a></li>
<li><a href="<?php echo WEBROOT; ?>compte&action=vip">? Devenir VIP</a></li>
<li><a href="<?php echo WEBROOT; ?>forum">? Forum</a></li>
<img src="theme/img/global/bottomUL.png"/>
</ul>
<a id="button1" href="<?php echo WEBROOT; ?>rejoindre"></a>
<ul>
<img src="theme/img/global/topUL.png"/>
<li><a href="<?php echo WEBROOT; ?>loterie">? Loterie</a></li>
<li><a href="<?php echo WEBROOT; ?>compte&action=extra">? Extras</a> <img src="theme/img/devtool/new.png" style="float:right;"/></li>
<li><a href="<?php echo WEBROOT; ?>points">? Les points</a></li>
<li><a href="<?php echo WEBROOT; ?>histoire">? Histoire</a></li>
<li><a href="<?php echo WEBROOT; ?>trailer">? Trailer</a></li>
<li><a href="<?php echo WEBROOT; ?>screens">? Screens</a></li>
<li><a href="<?php echo WEBROOT; ?>reglement">? Réglement</a></li>
<li><a href="<?php echo WEBROOT; ?>vote">? Vote & Gagne</a></li>
<li><a href="<?php echo WEBROOT; ?>tchat">? Tchat Box</a></li>
<img src="theme/img/global/bottomUL.png"/>
</ul>
<a id="button3" href="<?php echo WEBROOT; ?>loterie"></a>
</div>
<img src="theme/img/global/bottomMenu.png"/>
</div>
<div id="right">
<div id="member">
<div id="space">
<div id="connexion">
<form method="post" action="<?php echo WEBROOT; ?>connexion"/>
<input class="input" type="text" name="nom" style="margin:11px 0px 0px 27px;" value="Utilisateur" onfocus="this.value=''"/>
<input class="input" type="password" name="mdp" style="margin:51px 0px 0px 27px;" value="passe" onfocus="this.value=''"/>
<input type="hidden" name="verification" value="verification"/>
<input class="inputConnexion" type="submit" name="connexion" style="margin:88px 0px 0px 47px;" value=""/>
</form>
<div class="lien" style="font-size:12px;">
<a href="index87c3.html?p=inscription">Pas encore inscris ?</a><br/>
<a href="#">Mot de passe oublié ?</a>
</div>
</div>
</div>
</div>
<div id="ahdio">
<div style="position:absolute;z-index:100;margin:66px 0px 0px 153px">
<a href="http://streams3.museter.com/tunein.php/peanut1/playlist.pls"><img align="absmiddle" src="theme/img/devtool/winamp.png" border="0" alt="Winamp" title="Winamp" class="devtool"/></a>
<a href="http://streams3.museter.com/tunein.php/peanut1/playlist.asx"><img align="absmiddle" src="theme/img/devtool/windows.png" border="0" alt="windows Media Player" title="Windows Media Player" class="devtool"/></a><br/>
<a href="http://streams3.museter.com/tunein.php/peanut1/playlist.ram"><img align="absmiddle" src="theme/img/devtool/real.png" border="0" alt="Real Player" title="Real Player" class="devtool"/></a>
<a href="http://streams3.museter.com/tunein.php/peanut1/playlist.qtl"><img align="absmiddle" src="theme/img/devtool/quick.png" border="0" alt="QuickTime" title="QuickTime" class="devtool"/></a>
</div>
<div style="position:absolute;z-index:100;margin:61px 0px 0px 16px">
<embed type="application/x-shockwave-flash" src="theme/swf/dewplayer.swf" id="Player" name="player" bgcolor="#000000" quality="high" wmode="transparent" flashvars="mp3=http://173.193.9.73:8068/;stream.mp3&autoplay=0" height="50" width="135">
</div>
<div style="position:absolute;z-index:100;margin:127px 0px 0px 18px;font-size:12px;color:pink;">
» Auditeurs : <span class="info"><span id="cc_stream_info_listeners"></span> / <span id="cc_stream_info_maxlisteners"></span></span>
</div>
<marquee style="font-size:11px;color:pink;position:absolute;width:181px;height:14px;margin:155px 0px 0px 12px;" direction="left" scrollmount="2"><div id="cc_stream_info_song">Loading...</div></marquee>
<script language="javascript" type="text/javascript" src="http://streams3.museter.com/system/recenttracks.js"></script>
<script language="javascript" type="text/javascript" src="http://streams3.museter.com/js.php/tchoup/recenttracks/rnd0"></script>
<script language="javascript" type="text/javascript" src="http://streams3.museter.com/system/streaminfo.js"></script>
<script language="javascript" type="text/javascript" src="http://streams3.museter.com/js.php/tchoup/streaminfo/rnd0"></script>
</div>
<div id="boutique">
<p>
<img src="theme/img/devtool/rightBoutique.png" width="14px" height="14px" style="vertical-align:-18%"/> Blopanneau Multicolore Royal </p>
<a class="boutique" href="?p=boutique&type=5"></a>
<object style="position:absolute;margin-top:29px; margin-left:10px;" width="66" height="66" type="application/x-shockwave-flash" data="theme/swf/items/9/157.swf">
<param name="movie" value="theme/swf/items/9/157.swf"/>
<param name="wmode" value="transparent"/>
</object>
</div>
<div id="armurerie">
<form method="POST" action="?p=armurerie">
<input class="none" type="text" name="persoArmurerie" value="Rechercher un personnage ..." onfocus="this.value=''"/>
<input class="submit" type="submit" name="lookArmurerie" value=" "/>
</form>
</div>
<div id="lien">
<a href="#" class="facebook"></a>
<a href="#" class="twitter"></a>
<a href="#" class="youtube"></a>
</div>
</div><div id="gallery">
<img src="theme/img/global/gallery.png" class="supporter"/>
<div id="slide">
<div class="slider-wrapper theme-default">
<div class="ribbon"></div>
<div id="slider" class="nivoSlider">
<img src="theme/img/gallery/1.png" title=""/>
<img src="theme/img/gallery/2.png" title=""/>
<img src="theme/img/gallery/3.png" title=""/>
<img src="theme/img/gallery/4.png" title=""/>
<img src="theme/img/gallery/5.png" title=""/>
</div>
</div>
</div>
</div>
<div id="contenu">
<?php echo $pages; ?>
</div>
<div id="footer">
</div>
</div>
</body>
</html>
404.php
<?php
$head = "<title>Page introuvable !</title>"
?>
<img src="theme/img/global/topContenu.png"/> <div id="title"><img style="position:absolute;margin:19px 0px 0px -85px;"src="theme/img/devtool/new.png"/><span>Bienvenue sur le serveur Memento !</span>Bienvenue sur le serveur Memento !</div>
<img src="theme/img/global/hr.png" class="hr"/>
<h1>? Tu t'es perdu ?!</h1>
<p>Tu as voulu trop fouiller sur le site et tu t'es perdu. C'est un chemin sans issue ici, retourne vers l'accueil.</p>
<img src="theme/img/global/bottomContenu.png"/>
Voilà pour les infos.