Welcome to Dream.In.Code
Getting PHP Help is Easy!

Join 132,688 PHP Programmers for FREE! Get instant access to thousands of PHP experts, tutorials, code snippets, and more! There are 1,297 people online right now. Registration is fast and FREE... Join Now!




Chmod For Flatfile Data

 
Reply to this topicStart new topic

Chmod For Flatfile Data, read by php, not by the world

LuxFX
post 14 Oct, 2002 - 10:59 PM
Post #1


D.I.C Head

**
Joined: 9 Aug, 2001
Posts: 63

I'm having trouble finding the right chmod to use. I have a text file I'm using for data storage. It needs to be read/write-able from the PHP code, but I need it somewhat protected so that the world can't type the file name in and view the file.

if there are any alternative methods, I'm open to suggestions.

thanks!
LuxFX
User is offlineProfile CardPM

Go to the top of the page

Spider
post 14 Oct, 2002 - 11:06 PM
Post #2


Arachnid

****
Joined: 10 Jul, 2002
Posts: 769


My Contributions


if you want it write able by a browser page, then not really I'm afraid.

The only way to allow that with chmod is to allow user write access, therefore giving access to anyone.

I don't quite see what you mean by security though, people can't write to the file on your site... they would need your login to have modding access on your webspace.

if you can just edit the file personally and upload it again, then you can just leave the file with read only permissions, but if your running a php script that won't work.
User is offlineProfile CardPM

Go to the top of the page

gneato
post 14 Oct, 2002 - 11:12 PM
Post #3


<title>Untitled Document</title>

*****
Joined: 3 Sep, 2001
Posts: 1,311

Use SQL.


Although it's not hard to find sql passwords in php code...

makes it a tad more difficult.

If you can't use sql, umm

put the data file below the web viewable root

some hosts are set up like this...

/home/user/
/home/user/public_html/

if public_html contains the web site, /home/user/ could contain the database and it wouldn't be viewable from the web without another script.
User is offlineProfile CardPM

Go to the top of the page

LuxFX
post 15 Oct, 2002 - 11:42 AM
Post #4


D.I.C Head

**
Joined: 9 Aug, 2001
Posts: 63

I had considered using MySQL (that's how I'd done things like this in the past) but this is something I want to distribute with an application, so I want it as simple as possible.

I came up with a 'solution' last night -- I moved the files out of the public_html directory (or wwwroot or whatever, depending on the setup of your server) and into the main 'home' directory. I can still access them with script, but there's no way to get there through the web browser.

Is this logical? Is this something that most people with a hosting server can achieve? Again, this needs to be distributable, and relatively easy to 'install'.

thanks for the help!
-LuxFX
User is offlineProfile CardPM

Go to the top of the page

Fast ReplyReply to this topicStart new topic
Time is now: 11/23/08 07:30AM

Live PHP Help!

PHP Tutorials

Reference Sheets

PHP Snippets

Bye Bye Ads

Free DIC T-Shirt

T-Shirt Example

Related Sites

Monthly Drawing

Thumb Drive

Partners

Top Contributors

Top 10 Kudos This Month