Jump to content

Include page which includes other pages -- not working


njdirt

Recommended Posts

Hey,

  I'm trying to include a SImplePHP blog into another php page, and I keep getting errors of PHP not bieng able to find the includes of the page which I'm trying to include.  I only know how to do this with the simple "include("ddfsd")" method.  Maybe there is something better?

 

This is the page I want things to show up on : www.thrashbike.com/mine

 

This is the page I want to show up on the aforementioned page : www.thrashbike.com/mine/blog/index.php

 

Here is the code from mine/index.php :

<td align="left" width="500px">
            <?php include("blog/index.php"); ?>
        </td>

try this

<td align="left" width="500px">
            <?php include("/mine/blog/index.php"); ?>
        </td>

 

if not use absolute link:

<td align="left" width="500px">
            <?php include("www.thrashbike.com/mine/blog/index.php"); ?>
        </td>

The method I use to include using paths from the file you're on is the use of dirname(__FILE__).

 

include_once(dirname(__FILE__) .'/path/from/this/directory.php');

 

----------------

Now playing: Linkin Park - No More Sorrow (Live At Milton Keynes)

via FoxyTunes

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.