Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 4 of 4
  1. #1
    Senior Member
    Join Date
    Aug 2011
    Posts
    227
    Member #
    29153
    Liked
    4 times
    I have installed LAMP and have started working on my web site. For some reason, my include isn't working. Here is what I have.

    <?php

    $title="Study Question | Your Study Buddy";
    $currentpage="includes/pages/index.php";
    include "includes/page.php";

    ?>

    It will include a file if it is in the same folder. Why is it not included here?

  2.  

  3. #2
    Junior Member
    Join Date
    Nov 2011
    Posts
    14
    Member #
    29881
    Is the includes directory in the same directory as the file? If not, this should do it

    PHP Code:
    include "../includes/page.php"

  4. #3
    Senior Member
    Join Date
    Aug 2011
    Posts
    227
    Member #
    29153
    Liked
    4 times
    Quote Originally Posted by Jay1, post: 223908
    Is the includes directory in the same directory as the file? If not, this should do it

    PHP Code:
    include "../includes/page.php"
    I have tried that. Still doesn't work.

  5. #4
    WDF Staff AlphaMare's Avatar
    Join Date
    Oct 2009
    Location
    Montreal, Canada
    Posts
    4,570
    Member #
    20277
    Liked
    878 times
    Needs the parentheses:

    <?php

    $title="Study Question | Your Study Buddy";
    $currentpage="includes/pages/index.php";
    include ("includes/page.php");

    ?>
    Good design should never say "Look at me!"
    It should say "Look at this." ~ David Craib


    http://digitalinsite.ca ~ my current site . . info@digitalinsite.ca ~ my email

    If you feel that someone's post helped you fix your problem, answered your question, or just made you feel better, feel free to "Like" their post. The "Like" link is at the bottom right of each post, along side the "reply" link. And if you are being helped here, try to help someone else - pass it on!


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 05:52 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com