Web Hosting Vodahost    

Home Take The Royal Tour! Order Now Features Prices
Go Back   Web Hosting > VodaHost Web Hosting Support > mySQL & PHP

Notices

mySQL & PHP Discussions, information and help with mySQL and PHP.

Reply
 
Thread Tools
  #1  
Old 09-14-2009, 02:08 AM
Private First Class
 
Join Date: Sep 2009
Posts: 6
Question Please help define root directory for php include in subdirectory!

Hello everyone; I am in desperate need of some help with this!

I am constructing a website with css and php_includes. My problem is that I do not know how to reference the root directory (where the includes file is) from within a deep-rooted subdirectory.

I know that I can reference a file in the root directory from "root/sub/file" by prefixing the includes path with "../", however how can I reference the root from "root/sub/sub/file"?

I really would appreciate any help here as I have been searching the internet for an answer for the last three days!

Thank you for your time,

- Benjamin.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #2  
Old 09-14-2009, 11:56 AM
Second Lieutenant
 
Join Date: Apr 2009
Posts: 110
Default Re: Please help define root directory for php include in subdirectory!

Hi

This is a theory ok? Seems to me that all you have to do is to www.domain.com/include. Looks like you have been in the guru level and forgot the basic level. However, as I said, this is theory.

Cheers

Millie
www.subeagle.com
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #3  
Old 09-15-2009, 06:49 PM
navaldesign's Avatar
General & Forum Moderator
 
Join Date: Oct 2005
Location: Italy
Posts: 10,049
Default Re: Please help define root directory for php include in subdirectory!

Most VH servers are set NOT to allow URL includes. So the solution posted by millie won't work.

You can reference your includes file as:

/home/cpusername/public_html/includes_file.php if you are on a VH account .
__________________
Navaldesign
Logger Lite: Low Cost, Customizable, multifeatured Login script
Instant Download Cart: a Powerfull, Customized, in site, DB driven, e-products Cart
DBTechnosystems.com Forms, Databases, Shopping Carts, Instant Download Carts, Loggin Systems and more....
Advanced BlueVoda Form Processor : No coding form processor! Just install and use! Now with built in CAPTCHA!

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #4  
Old 09-16-2009, 10:58 AM
Second Lieutenant
 
Join Date: Apr 2009
Posts: 110
Default Re: Please help define root directory for php include in subdirectory!

Hi

So, that means the include codes are in the include_file.php, right? But /home/cpusername/public_html/... would really say (in my case)
/www.subeagle.com/mycpusername/pub... (with the www in front of subeagle), right NavalDesign?

Thanks

Millie
www.subeagle.com
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #5  
Old 09-16-2009, 11:36 AM
navaldesign's Avatar
General & Forum Moderator
 
Join Date: Oct 2005
Location: Italy
Posts: 10,049
Default Re: Please help define root directory for php include in subdirectory!

Quote:
So, that means the include codes are in the include_file.php, right?
Correct, or whatever else the file to be included is called.


Quote:
But /home/cpusername/public_html/... would really say (in my case)
/www.subeagle.com/mycpusername/pub... (with the www in front of subeagle
No, i mean what i wrote: /home/cpusername/public_html/

No www, no subeagle.com. Just replace the "mycpusername" with your real CP username.

This is the path to your root folder.
Of course this assumes that the file you need to include is in your root folder, as you posted above.
__________________
Navaldesign
Logger Lite: Low Cost, Customizable, multifeatured Login script
Instant Download Cart: a Powerfull, Customized, in site, DB driven, e-products Cart
DBTechnosystems.com Forms, Databases, Shopping Carts, Instant Download Carts, Loggin Systems and more....
Advanced BlueVoda Form Processor : No coding form processor! Just install and use! Now with built in CAPTCHA!

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off



All times are GMT +1. The time now is 01:52 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC7
2005-2009 VodaHost Web Hosting Your Perfect Web Host - All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203