Jump to content


Photo

HELP how to call root directory from a folder within??


  • Please log in to reply
5 replies to this topic

#1 Wideawake

Wideawake
  • New Members
  • Pip
  • Newbie
  • 7 posts

Posted 23 July 2006 - 10:15 PM

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

#2 redarrow

redarrow
  • Members
  • PipPipPip
  • Advanced Member
  • 7,308 posts
  • Locationlondon

Posted 23 July 2006 - 10:26 PM

example ok.

include="header.php";
include("header.php");
require_once("header.php");
require("include.php");

Wish i new all about php DAM i will have to learn
((EMAIL CODE THAT WORKS))
http://simpleforum.ath.cx/mail2.inc
((PAYPAL INTEGRATION THAT WORKS))
http://simpleforum.a...aypal1_info.inc

#3 Wideawake

Wideawake
  • New Members
  • Pip
  • Newbie
  • 7 posts

Posted 23 July 2006 - 11:06 PM

example ok.

include="header.php";
include("header.php");
require_once("header.php ");
require("include.php");


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 ;)

#4 Wideawake

Wideawake
  • New Members
  • Pip
  • Newbie
  • 7 posts

Posted 24 July 2006 - 12:13 AM

oh and my header is not wrong it really is labeled as _header.php

#5 trq

trq
  • Staff Alumni
  • Advanced Member
  • 31,041 posts

Posted 24 July 2006 - 12:24 AM

You use two dots to move up one directory. eg;

include "../_header.php"; // up one.
include "../../_header.php"; up two.


#6 Wideawake

Wideawake
  • New Members
  • Pip
  • Newbie
  • 7 posts

Posted 24 July 2006 - 12:32 AM

I knew it was a simple ?, thanks that done it. the only thing I didnt try lol i tried .. and //. Thanks for the reply ;)




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users