Visit Jeremy's Blog.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 08-23-2002, 08:33 AM   #1
Registered: Apr 2002
Posts: 549

Rep: Reputation: 30
PHP/CGI help

How do I access a file using local file paths instead of the URL
path from a PHP script? I'm trying to allow only trusted (logged on)
users to access certain restricted files so the files must not be
directly accessible from a URL.

eg. I have the following directory layout...


public_html is mapped by the web server to my ~$USER

How can a script from inside public_html access the private_files
Old 08-23-2002, 08:45 AM   #2
Registered: Aug 2001
Location: South Carolina, USA
Distribution: Redhat 8.0/Custom
Posts: 96

Rep: Reputation: 16
You can use fopen, readfile, ....

Look here for working with local files:
Old 08-23-2002, 02:12 PM   #3
Senior Member
Registered: Jan 2002
Location: germany
Distribution: ubuntu, mint, suse
Posts: 1,550

Rep: Reputation: 136Reputation: 136
why don't u write a script asking for authorization, then u include "authorization.php"; in the private files. so nothing else will be displayed to visitors not logged in.
if u're working with apache there might be a chance of excluding unknown vistors using the .htaccess file. see apache manual for that.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Which one is best? CGI : PHP : ASP coolguy_iiit Programming 12 05-02-2005 02:35 AM
php apache or php cgi - php learner rblampain Linux - Security 3 12-17-2004 11:10 PM
php rpm as cgi .shapeShifter Linux - Software 4 04-11-2003 01:40 AM
php as cgi nakkaya Linux - Software 3 03-18-2003 02:42 AM
php cgi jayakrishnan Linux - General 1 11-27-2002 09:43 AM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 12:45 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration