LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
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, 08: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, 08: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, 02:12 PM   #3
j-ray
Senior Member
 
Registered: Jan 2002
Location: germany
Distribution: ubuntu, mint, suse
Posts: 1,591

Rep: Reputation: 145Reputation: 145
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



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

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 07:47 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
Open Source Consulting | Domain Registration