Closed Thread
Results 1 to 5 of 5

Thread: PHP Includes dont work

  1. #1
    chaganlal1's Avatar
    chaganlal1 is offline x10 Elder chaganlal1 is an unknown quantity at this point
    Join Date
    Feb 2005
    Location
    SC
    Posts
    1,007

    PHP Includes dont work

    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 Code:
    <?php include('/folder2/includepage.php'); ?>
    but it dosent work. can anyone please help me - thanks

  2. #2
    Bryon is offline Administrator Bryon has disabled reputation
    Join Date
    Apr 2005
    Location
    Northfield, NH
    Posts
    7,608

    Re: PHP Includes dont work

    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

  3. #3
    jensen's Avatar
    jensen is offline x10 Lieutenant jensen is an unknown quantity at this point
    Join Date
    Nov 2005
    Location
    At my desk
    Posts
    438

    Re: PHP Includes dont work

    Maybe this site can help you with its tutorials

    http://www.netcode.net/tutorials/php_mysql/
    "For I am not ashamed of the gospel of Christ: for it is the power of God unto salvation to every one that believeth" Romans 1:16

  4. #4
    084club is offline x10Hosting Member 084club is an unknown quantity at this point
    Join Date
    May 2006
    Posts
    7

    Re: PHP Includes dont work

    Thanks ............ very nice :D

  5. #5
    chaganlal1's Avatar
    chaganlal1 is offline x10 Elder chaganlal1 is an unknown quantity at this point
    Join Date
    Feb 2005
    Location
    SC
    Posts
    1,007

    Re: PHP Includes dont work

    Whoea it was just the dot. It works great now thanks. Cant believe It was that simple.

Closed Thread

Similar Threads

  1. tons of PHP Resources
    By Chris S in forum Scripts & 3rd Party Apps
    Replies: 10
    Last Post: 01-16-2009, 10:07 AM
  2. Unstand PHP?
    By o0slowpaul0o in forum Tutorials
    Replies: 8
    Last Post: 01-07-2008, 09:16 PM
  3. PHP: Includes Tutorial
    By pulse__xx in forum Tutorials
    Replies: 14
    Last Post: 07-27-2006, 11:15 AM
  4. php files wont work
    By brentcatoe in forum Free Hosting
    Replies: 1
    Last Post: 09-22-2005, 10:50 AM
  5. Does PHP work?
    By Hermoine22 in forum Scripts & 3rd Party Apps
    Replies: 4
    Last Post: 07-25-2005, 12:03 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers