View previous topic :: View next topic |
Author |
Message |
Gannyaa -
Joined: 29 Sep 2006 Posts: 93 Location: Nelson, BC -- Canada
|
Posted: Fri Feb 09, 2007 4:10 pm Post subject: How to get PHP to use relative filenames... |
|
|
I've been learning PHP since I got my Abyss Server ware, but now I am having trouble with relative links.
Problem is I have a lot of counters and other changing dynamic data on my website and I would like to put all the counters their own folder.
so root folder is /webserver/
counter.php is sitting in /webserver/2005/folder/counter.php
and counter.txt is in /webserver/counters/
How do I get php to read and write to the counters folder from the /webserver/2005/folder/?
PHP can't find that folder ... it keeps looking in the current folder its sitting in! _________________ Todd (Gannyaa)
http://iGannyaa.bebo.com/
http://haidavision.no-ip.info/gannyaa/newblog.htm |
|
Back to top |
|
|
cmxflash -
Joined: 11 Dec 2004 Posts: 872
|
Posted: Fri Feb 09, 2007 5:49 pm Post subject: |
|
|
Try using ../../counters/counter.txt |
|
Back to top |
|
|
aprelium -
Joined: 22 Mar 2002 Posts: 6800
|
Posted: Fri Feb 09, 2007 10:51 pm Post subject: Re: How to get PHP to use relative filenames... |
|
|
Gannyaa,
Are you using Windows? Is /webserver/2005/folder/counter.php the real path in your hard drive of that file? _________________ Support Team
Aprelium - http://www.aprelium.com |
|
Back to top |
|
|
pkSML -
Joined: 29 May 2006 Posts: 952 Location: Michigan, USA
|
Posted: Sat Feb 10, 2007 5:15 pm Post subject: |
|
|
Relative paths to counter.txt (works for filesystem calls and URLs when URL is available to server)
It's in current directory --> ./counter.txt
It's up one directory --> ../counter.txt
It's up two directories --> ../../counter.txt
It's in a subdirectory called today --> ./today/counter.txt
For filesystem calls, you might also consider hard-coded paths: (think a relative path that starts with the drive root)
/abyss/htdocs/today/counter.txt _________________ Stephen
Need a LitlURL?
http://CodeBin.yi.org |
|
Back to top |
|
|
Gannyaa -
Joined: 29 Sep 2006 Posts: 93 Location: Nelson, BC -- Canada
|
|
Back to top |
|
|
Gannyaa -
Joined: 29 Sep 2006 Posts: 93 Location: Nelson, BC -- Canada
|
Posted: Tue Feb 13, 2007 10:46 pm Post subject: I had to re ply again! |
|
|
Thanks cmxflash. I used that precisely ../../
I am using windows...
and I find php not as friendly as javascript or html or css
My actual web folder dir setup is kinda like...
my web
|_beach
|_gannyaa
|_wynston
each folder is set up sorta like so
/wynston/2005/
/wynston/2006/
/wynston/2007/
/wynston/2007/sir_kelsea/userdata/
/wynston/gbook/
/wynston/gbook/emotions/
/wynston/gbook/img/
/wynston/images/
/wynston/images/butterflys/
/wynston/scripts/
I'm not relocating the userdata into a separate folder but keeping the comment script (gbook) accessible by all php pages.
You're reply's have been most useful. I am still playing around with the captcha script ... but first I need my ArgoSoft to work with PHP. _________________ Todd (Gannyaa)
http://iGannyaa.bebo.com/
http://haidavision.no-ip.info/gannyaa/newblog.htm |
|
Back to top |
|
|
|