Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

[PHP] Including a file from root directory when i'm in /music/lyrics

Experienced Elementalist
Joined
Mar 22, 2008
Messages
297
Reaction score
0
The topic should be self-explainable.

In the file /music/lyrics/forsta_ronden.php i want to include the files header.php and footer.php whos is in the root directory.

I've tryed
PHP:
<?php include 'header.php'; ?>

<?php include '/header.php'; ?>

<?php include '/../header.php'; ?>

<?php include '/../../header.php'; ?>

But none of them worked, i get the same error;
Code:
Warning: include(/../../header.php) [function.include]: failed to open stream: No such file or directory in E:\xampp\htdocs\the_old_farm\music\lyrics\forsta_ronden.php on line 2

Any suggestions?
 

Loyal Member
Joined
Feb 26, 2007
Messages
640
Reaction score
255
PHP:
<?php
include "../../header.php";
include "../../footer.php";
?>
 
Experienced Elementalist
Joined
Mar 22, 2008
Messages
297
Reaction score
0
It worked, but the links and the css got fucked up now.

The links are linking to pages in the music/lyrics directory and the css don't show up, in header.php i used
PHP:
<link rel="stylesheet" href="images/style.css" type="text/css" />

EDIT:
Fixed the links by adding "/" be4 them in header.php
 
Back
Top