LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
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.

Notices



Reply
 
Search this Thread
Old 08-23-2002, 09:33 AM   #1
ugenn
Member
 
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
~/private_files

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

How can a script from inside public_html access the private_files
directory.
 
Old 08-23-2002, 09:45 AM   #2
no2nt
Member
 
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:
http://www.php.net/manual/en/ref.filesystem.php
 
Old 08-23-2002, 03:12 PM   #3
j-ray
Senior Member
 
Registered: Jan 2002
Location: germany
Distribution: ubuntu
Posts: 1,457

Rep: Reputation: 104Reputation: 104
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.
cheers,
jens
 
  


Reply


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 03:35 AM
php apache or php cgi - php learner rblampain Linux - Security 3 12-18-2004 12:10 AM
php rpm as cgi .shapeShifter Linux - Software 4 04-11-2003 02:40 AM
php as cgi nakkaya Linux - Software 3 03-18-2003 03:42 AM
php cgi jayakrishnan Linux - General 1 11-27-2002 10:43 AM


All times are GMT -5. The time now is 08:17 AM.

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