View previous topic :: View next topic |
Author |
Message |
NewfieBilko Smarty Regular
Joined: 21 Jun 2004 Posts: 41
|
Posted: Fri Jul 16, 2004 12:36 pm Post subject: How to reference SETUP.php from a extended folder |
|
|
Hey guys.. Using smarty.. I have all my setup files in the /root, if i wanted to make say an admin section, seperate from the root, say in folder root/admin, and had files in there, how can i reference the setup.php in the precending folder.
I say in my admin.php:
[php:1:f459160867]<?php
require_once '../setup.php';
?>[/php:1:f459160867]
??????
this does not work |
|
Back to top |
|
NewfieBilko Smarty Regular
Joined: 21 Jun 2004 Posts: 41
|
Posted: Fri Jul 16, 2004 1:15 pm Post subject: |
|
|
ok ../smarty does work, but when i go any further (put templates in the admin folder), and set it up, the application is still trying to reference as if everything is in the admin folder, which is not, example:
Failed opening required 'Smarty/Smarty_Compiler.class.php' (include_path='.:/usr/share/pear') in /var/www/php2/Smarty/Smarty.class.php on line 1009 |
|
Back to top |
|
NewfieBilko Smarty Regular
Joined: 21 Jun 2004 Posts: 41
|
Posted: Mon Jul 19, 2004 3:39 am Post subject: |
|
|
The refence will load the setup file, but then the admin.php will try and call everything as if the setup was in the admin/ folder, like it will load lang files from /admin/lang when they are in the httd/land.. Simple problem but a confusing thing to find out. |
|
Back to top |
|
NewfieBilko Smarty Regular
Joined: 21 Jun 2004 Posts: 41
|
Posted: Mon Jul 19, 2004 3:39 am Post subject: |
|
|
Help! |
|
Back to top |
|
mensi Smarty n00b
Joined: 29 Jun 2004 Posts: 4 Location: Switzerland -> Zug
|
Posted: Thu Jul 22, 2004 12:46 am Post subject: |
|
|
Try using absolute paths
If you want to do so without knowing the base dir you can do it this way:
include dirname(__FILE__).'/realtive/path/to/file.php';
And here a further hint for you
Remember that we aren't in a real life conversation so nobody is deaf here ergo: you do not have to write things several times... They get through the first time... _________________ kernel, n.: A part of an operating system that preserves the medieval traditions of sorcery and black art. |
|
Back to top |
|
boots Administrator
Joined: 16 Apr 2003 Posts: 5611 Location: Toronto, Canada
|
Posted: Thu Jul 22, 2004 1:16 am Post subject: |
|
|
@NewfieBilko: try this thread -- http://www.phpinsider.com/smarty-forum/viewtopic.php?t=1268
@mensi: yeah, shout outs can be tiresome but sometimes it helps get some traction. Squeaky wheel and all that. Besides, if NewfieBilko is really a newfie, then I am sure it is intended in the best of spirits and charm. |
|
Back to top |
|
NewfieBilko Smarty Regular
Joined: 21 Jun 2004 Posts: 41
|
Posted: Tue Jul 27, 2004 4:29 pm Post subject: |
|
|
LOL Ya knows it brotha, Hell ya, straight outta st. johns city, and if i could help people on this more, i would, but for I am still learning |
|
Back to top |
|
|