[AIDE] Problème include.

Résolu
ultra_nezz Messages postés 11 Date d'inscription jeudi 11 novembre 2004 Statut Membre Dernière intervention 24 juin 2009 - 23 sept. 2008 à 11:26
ultra_nezz Messages postés 11 Date d'inscription jeudi 11 novembre 2004 Statut Membre Dernière intervention 24 juin 2009 - 23 sept. 2008 à 12:03
Bonjour,

Pour se mettre dans le contexte, voici l'arborescence du site :
       

Voici maintenant le code de quelques pages :

header.php

<?php
include('./config.php');
include(''.$racine.'_bdd/connect.php');
include(''.$racine.'fonctions.php');
$style = mysql_query("SELECT url, nom FROM style WHERE actif="oui"");
$url_design = mysql_fetch_array ($style);
?>
<html>
<head>
<link rel="stylesheet" type="text/css" href="<?php echo $racine.$url_design['url']; ?>style.css" title="<?php echo $url_design['nom']; ?>" />
<link rel="icon" type="image/png" href="<?php echo $racine.$url_design['url']; ?>favicon.ico" />
</head>

   

    [<?php echo $racine; ?> ]
   
           
<?php
echo '
',"\r\n";
include(''.$racine.'menu.php');
echo '
',"\r\n";
echo '
',"\r\n";

config.php

<?php
$racine = 'http://localhost/blog/';
?>

/_admin/galerie_tool.php

<?php
include('../config.php');
include(''.$racine.'header.php');

Le problème
:

Alors quand je mets dans mon header.php

include('''.$racine.'_bdd/connect.php');
include('''.$racine.'fonctions.php');

Il m'affiche ceci (depuis la page _admin/galerie_tool.php):

Warning: include(http://localhost/blog/_bdd/connect.php) [function.include]: failed to open stream: HTTP request failed! HTTP/1.1 403 Forbidden
in C:\wamp\www\blog\header.php on line 3
Warning: include() [function.include]: Failed opening 'http://localhost/blog/_bdd/connect.php' for inclusion (include_path ='.;C:\php5\pear') in C:\wamp\www\blog\header.php on line 3
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in C:\wamp\www\blog\header.php on line 6

http://localhost/blog/
http://localhost/blog/index.phphttp://localhost/blog/about.phphttp://localhost/blog/contact.phphttp://localhost/blog/galerie.php

Fatal error: Call to undefined function date_fr() in C:\wamp\www\blog\comments.php on line 9

J'ai bien vérifié, c'est à cause de  '.$racine.' . Ce qui me parrait bizarre c'est que l'include menu.php (en vert dans le code header.php)  il me le fait correctement !
De plus, il ne fait pas l'include de _bb/connect.php ET de fonctions.php

Je suis perdu....Quelqu'un pour m'aider s'il vous plait ?

2 réponses

cs_laurent1024 Messages postés 987 Date d'inscription mardi 31 mai 2005 Statut Membre Dernière intervention 30 août 2012 25
23 sept. 2008 à 11:48
Pourquoi ne pas remplacer ton include(''.$racine.'_bdd/connect.php');
par include('./_bdd/connect.php');
3
ultra_nezz Messages postés 11 Date d'inscription jeudi 11 novembre 2004 Statut Membre Dernière intervention 24 juin 2009
23 sept. 2008 à 12:03
C'est fait, ça marche. J'avais testé mais entre le post et la réponse j'ai modifié pleins de choses, la combinaison des deux fait que ça marche. Alors je vais pas chercher plus loin, pas motivé ça m'a pris le choux.

Merci.
0
Rejoignez-nous