Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
What should the file permissions be set to on this file?
Old 08-13-2007, 04:22 PM What should the file permissions be set to on this file?
Nathand's Avatar
Extreme Talker

Posts: 233
Location: USA
Trades: 0
Hi, I have a .txt file that I want to be able to read and write to from my php scripts, but I don't want the public to be able to view this file. What should I change the file permissions settings to? I tried 770 in Cpanel, but then I get an error when I run the php script that access is denied?

Thanks for the help,
Nathan
Nathand is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 08-13-2007, 04:46 PM Re: What should the file permissions be set to on this file?
JamieLewis's Avatar
Pretty Much a Big Deal...

Latest Blog Post:
Gooie
Posts: 385
Name: Jamie Lewis
Location: UK
Trades: 0
Hmm, 777 will work and then you could use .htaccess to stop the public from viewing the file.

Jamie
__________________

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE
JamieLewis is offline
Reply With Quote
View Public Profile Visit JamieLewis's homepage!
 
Old 08-13-2007, 07:30 PM Re: What should the file permissions be set to on this file?
Nathand's Avatar
Extreme Talker

Posts: 233
Location: USA
Trades: 0
Thanks. I added a .htaccess to my sites root directory and put this in it:

Code:
Options All -Indexes

<FilesMatch logfile.html>
AuthName "Restricted File"
AuthType Basic
AuthUserFile ./.htpasswd
require valid-user
</FilesMatch>
I also added a .htpasswd file in the same folder as the .htaccess file, but when I go to the "logfile.html" and the login box comes in, the username/pass I put in the .htpasswd file doesn't work. The login box just keeps refreshing?

Thanks for your help,
Nathan

Last edited by Nathand; 08-13-2007 at 07:41 PM..
Nathand is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to What should the file permissions be set to on this file?
 

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 On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.11708 seconds with 12 queries