Wideawake Posted July 23, 2006 Share Posted July 23, 2006 Ok so I tried installing a script of a test site. Got everthing working except the .phps which are in a different folder. Ok so my index pulls info like this and it works <? include("_header.php"); $title = "mysite ;)";include ('title.php'); ?>this is in the root folder. but my other pages inside of folders within the root, are set up the same way and dont pull the info like it should. I can place those pages in the root and the work, but within another folder they dont. Im sure its a easy fix, but im a complete n00b and cluess. Any help would be greatly appreciated.Thx,Mike Quote Link to comment https://forums.phpfreaks.com/topic/15428-help-how-to-call-root-directory-from-a-folder-within/ Share on other sites More sharing options...
redarrow Posted July 23, 2006 Share Posted July 23, 2006 example ok.include="header.php";include("header.php");require_once("header.php");require("include.php"); Quote Link to comment https://forums.phpfreaks.com/topic/15428-help-how-to-call-root-directory-from-a-folder-within/#findComment-62542 Share on other sites More sharing options...
Wideawake Posted July 23, 2006 Author Share Posted July 23, 2006 [quote author=redarrow link=topic=101597 .msg402206#msg402206 date=1153693589]example ok.include="header.php";include("header.php");require_once("header.php ");require("include.php");[/quote]huh? u lost me.... the example I posted works fine in the root, but the .phps in folders within the root it doesn't work. I being a n00b can only guess theres a command to tell it to look in the root or one directory up. but I'm new to al this.say the example I posted above is my index.php, it works in the root, but if I move to say folder /includes it doesn't pull those like it should. any suggestions. I need help quick ;) Quote Link to comment https://forums.phpfreaks.com/topic/15428-help-how-to-call-root-directory-from-a-folder-within/#findComment-62549 Share on other sites More sharing options...
Wideawake Posted July 24, 2006 Author Share Posted July 24, 2006 oh and my header is not wrong it really is labeled as _header.php Quote Link to comment https://forums.phpfreaks.com/topic/15428-help-how-to-call-root-directory-from-a-folder-within/#findComment-62574 Share on other sites More sharing options...
trq Posted July 24, 2006 Share Posted July 24, 2006 You use two dots to move up one directory. eg;[code=php:0]include "../_header.php"; // up one.include "../../_header.php"; up two.[/code] Quote Link to comment https://forums.phpfreaks.com/topic/15428-help-how-to-call-root-directory-from-a-folder-within/#findComment-62579 Share on other sites More sharing options...
Wideawake Posted July 24, 2006 Author Share Posted July 24, 2006 I knew it was a simple ?, thanks that done it. the only thing I didnt try lol i tried .. and //. Thanks for the reply ;) Quote Link to comment https://forums.phpfreaks.com/topic/15428-help-how-to-call-root-directory-from-a-folder-within/#findComment-62583 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.