njdirt Posted August 4, 2008 Share Posted August 4, 2008 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> Link to comment https://forums.phpfreaks.com/topic/118135-include-page-which-includes-other-pages-not-working/ Share on other sites More sharing options...
elflacodepr Posted August 4, 2008 Share Posted August 4, 2008 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> Link to comment https://forums.phpfreaks.com/topic/118135-include-page-which-includes-other-pages-not-working/#findComment-607784 Share on other sites More sharing options...
dezkit Posted August 4, 2008 Share Posted August 4, 2008 add "http://" in the beginning Link to comment https://forums.phpfreaks.com/topic/118135-include-page-which-includes-other-pages-not-working/#findComment-607792 Share on other sites More sharing options...
LemonInflux Posted August 4, 2008 Share Posted August 4, 2008 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 Link to comment https://forums.phpfreaks.com/topic/118135-include-page-which-includes-other-pages-not-working/#findComment-607802 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.