PHP Include Help?

Status
Not open for further replies.
Messages
21
Reaction score
0
Points
0
In a index.php file on a section of my website, I have several PHP includes like this one:

PHP:
<?php include('./xy7/2/include/header1.php'); ?>

This does not work when I load the index file, nor do any of the other ones. Can anybody help me with this?
 

Livewire

Abuse Compliance Officer
Staff member
Messages
18,169
Reaction score
216
Points
63
Try it without the leading ./ and see if it works; include is not a blocked function and it works perfectly within CMS's like Joomla and Wordpress, so it's going to end up being a code problem.
 

Livewire

Abuse Compliance Officer
Staff member
Messages
18,169
Reaction score
216
Points
63
Where/what subdirectory is it in on your site? The includes are working on the main site so it's gotta be a code problem. I'm heading away from my PC for a bit but I can check into it when I get back; no guarantees I'll be able to figure it out (I'm not an expert at PHP) but I'm willing to give it a shot.
 

descalzo

Grim Squeaker
Community Support
Messages
9,373
Reaction score
326
Points
83
PHP:
<?php include('include/header1.php'); ?>

OR

PHP:
<?php include('/home/cPanelUSERNAME/public_html/xy7/2/include/header1.php'); ?>

assuming the directory xy7 is in public_html
 
Status
Not open for further replies.
Top