Web Analytics Made Easy -
StatCounter Problems with php include - CodingForum

Announcement

Collapse
No announcement yet.

Problems with php include

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Problems with php include

    Hey guys,

    I'm trying to use a php include statement in my code and it works fine in the root folder, but when I create a subfolder and put php files in there, it doesn't see the include file.

    This is the include code that i use...

    [PHP][<?php include("/include/footer.shtml"); ?>/PHP]

    Like I said above it works fine as long as the php file I'm trying to access is in the same folder or heiarchy as the include file, but when I try to pull the include file from a subfolder I can't see it. I don't have any problems with pulling images from my "images" folder but with the include I do...

    Any ideas?
    Nicholas Milam
    Website Design and Tutorials
    http://www.betabuilders.com

  • #2
    This is subtle, but see the period I inserted.
    It's a path reference that tells it to reference from the current directory ...

    <?php include("./include/footer.shtml"); ?>

    Comment


    • #3
      well that worked!! Thanks for the help!!
      Nicholas Milam
      Website Design and Tutorials
      http://www.betabuilders.com

      Comment

      Working...
      X