PHP Includes dont work

Status
Not open for further replies.

chaganlal1

New Member
Messages
2,014
Reaction score
0
Points
0
hey i have a file in my /folder/page1.php folder and i want to include a file from another folder like /folder2/includepage.php but i cant seem to make it work..what am i doing wrong?
I have already put
PHP:
<?php include('/folder2/includepage.php'); ?>
but it dosent work. can anyone please help me - thanks
 

Bryon

I Fix Things
Messages
8,149
Reaction score
101
Points
48
Are you using the correct path to the file? I see in the example include you provided that you used a forward-slash before the directory. That would attempt to look for that directory at the base of the server's hard drive\system\whatever. Try using "./" rather then just "/" to include the file. Also remember that you can go "backwards" with "../" in the include construct.

http://us3.php.net/manual/en/function.include.php
 

chaganlal1

New Member
Messages
2,014
Reaction score
0
Points
0
Whoea it was just the dot. It works great now thanks. Cant believe It was that simple.
 
Status
Not open for further replies.
Top