Server Administration
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Codewalkers ForumsOther TechnologiesServer Administration

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Codewalkers Forums Sponsor:
Be the architects of evolution and help create the mobile internet future. It’s your move---enter to win here!
  #1  
Old October 12th, 2005, 09:29 PM
willjzab willjzab is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Denver, CO, USA
Posts: 2 willjzab User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via Yahoo to willjzab
accessing files outside document root

Ive looked all over (well probaby not ALL over) and I couldn't find a suitable answer, so here is my question:

How would I go about accessing files outside my document root with Apache2 on Win Std Server 2003 with a php script?
the script always dies at the opendir :
php Code:
Original - php Code
  1.  
  2.     $data_filedir = "data";
  3.     $data_handle = opendir($data_filedir) or die("$data_filedir is not a dir");
  4.     while (false !== ($data_file = readdir($data_handle))) {
  5.         $lastname_from_file = substr($data_file,0,strlen($row2[lastname]));
  6.         if ($data_file != "." && $data_file != "..") {
  7.             if ( strcasecmp($lastname_from_file,$row2[lastname]) == 0) {
  8.                 $data_file_array[]=$data_file;
  9.             }
  10.         }
  11.     }
  12.     closedir($data_handle);

Reply With Quote
  #2  
Old October 27th, 2005, 06:28 PM
Anonymous Anonymous is offline
Registered User
Codewalkers God 35th Plane (22000 - 22499 posts)
 
Join Date: Apr 2007
Posts: 22,309 Anonymous User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 24
RE: accessing files outside document root

I don't know that you really want to do.
Look, this is what worked out for me.
I'm hosted on a commercial server
so the directory structure is somethink like
/home/public_html/
Let's say that I have an index.php on public_html/
Here i want to include /home/sql_connection.php
I just use relative paths
In index.php i would use something like
php Code:
Original - php Code
  1.  
  2. include ('../sql_connection.php');


So something like:
php Code:
Original - php Code
  1.  
  2. $data_filedir = '../data';

might work for you, just maybe!

Reply With Quote
  #3  
Old November 2nd, 2005, 12:22 AM
sleighboy sleighboy is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 49 sleighboy User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
RE: accessing files outside document root

Just use an absolute path, remember to escape the backslashes though.


c:\winnt\somefile.txt

Reply With Quote
Reply

Viewing: Codewalkers ForumsOther TechnologiesServer Administration > accessing files outside document root


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway