Bonjour,
J'ai un soucis je voudrais inclure a mes pages le header,menu etc mais ça ne fonctionne pas j'ai une erreur php
(sur ma index.php qui se trouve a la racine sa fonctionne)

Ce que je veux

Voici mon répertoire www de wamp

index.php
/assets:
images
js
css
materialize
header.php
menu.php
slider.php
footer.php
script.php

/pages
  team.php
  connexion.php
  inscription.php
  contact.php

Je veux inclure par exemple dans ma page team.php
header.php,menu.php,footer.php qui se trouve dans le dossier assets
donc sur ma page team.php j'ai fait comme ceci:

<?php include ("/assets/header.php"); ?>
<?php include ("/assets/menu.php"); ?>
<?php include ("/assets/footer.php"); ?>

Ce que j'obtiens

( ! ) Warning: include(/assets/header.php): failed to open stream: No such file or directory in C:\wamp64\www\pages\team.php on line 1
Call Stack

Time Memory Function Location

1 0.0006 361608 {main}( ) ...\team.php:0

( ! ) Warning: include(): Failed opening '/assets/header.php' for inclusion (include_path='.;C:\php\pear') in C:\wamp64\www\pages\team.php on line 1
Call Stack

Time Memory Function Location

1 0.0006 361608 {main}( ) ...\team.php:0

( ! ) Warning: include(/assets/menu.php): failed to open stream: No such file or directory in C:\wamp64\www\pages\team.php on line 2
Call Stack

Time Memory Function Location

1 0.0006 361608 {main}( ) ...\team.php:0

( ! ) Warning: include(): Failed opening '/assets/menu.php' for inclusion (include_path='.;C:\php\pear') in C:\wamp64\www\pages\team.php on line 2
Call Stack

Time Memory Function Location

1 0.0006 361608 {main}( ) ...\team.php:0

( ! ) Warning: include(/assets/footer.php): failed to open stream: No such file or directory in C:\wamp64\www\pages\team.php on line 3
Call Stack

Time Memory Function Location

1 0.0006 361608 {main}( ) ...\team.php:0

( ! ) Warning: include(): Failed opening '/assets/footer.php' for inclusion (include_path='.;C:\php\pear') in C:\wamp64\www\pages\team.php on line 3
Call Stack

Time Memory Function Location

1 0.0006 361608 {main}( ) ...\team.php:0

2 réponses


@Grégory K ,ça ne change rien sans le / j'ai déja essayer

Merci a toi ça fonctionne désoler de vous avoir déranger juste pour ça