10 Replies - 1727 Views - Last Post: 19 December 2002 - 09:41 AM Rate Topic: -----

#1 Koenie  Icon User is offline

  • What?!

Reputation: 0
  • View blog
  • Posts: 1,313
  • Joined: 08-July 02

secure a .txt file

Posted 17 December 2002 - 06:05 AM

I have a .txt file and I don't want anyone to view it (including myself) but I still want my PHP scripts be able to read it and write to it. Is there a way of securing that .txt file like that?

Thanks, Koenie
Is This A Good Question/Topic? 0
  • +

Replies To: secure a .txt file

#2 fyrestorm  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 10
  • View blog
  • Posts: 3,113
  • Joined: 04-April 02

Re: secure a .txt file

Posted 17 December 2002 - 06:16 PM

yup there is, it's called a .htaccess page, and i'll tell you how to make it, in a moment, gotta pull up the code...
Was This Post Helpful? 0
  • +
  • -

#3 fyrestorm  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 10
  • View blog
  • Posts: 3,113
  • Joined: 04-April 02

Re: secure a .txt file

Posted 17 December 2002 - 06:18 PM

ok create a file named .htaccess

and put the following in it

<files "*.*"> 
deny from all 
</files> 



and then upload it to the dir where the file you don't want anyone to see is. i usually make a config folder and it only ever contains a config file and the .htaccess file

hope this helps you, if not ask more and i'll try to help you out better
Was This Post Helpful? 0
  • +
  • -

#4 gneato  Icon User is offline

  • <title>Untitled Document</title>

Reputation: 0
  • View blog
  • Posts: 1,311
  • Joined: 03-September 01

Re: secure a .txt file

Posted 18 December 2002 - 02:03 AM

That won't prevent people with shell access from viewing it.
Was This Post Helpful? 0
  • +
  • -

#5 fyrestorm  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 10
  • View blog
  • Posts: 3,113
  • Joined: 04-April 02

Re: secure a .txt file

Posted 18 December 2002 - 08:51 AM

then what do you suggest?
Was This Post Helpful? 0
  • +
  • -

#6 Quik  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 2
  • View blog
  • Posts: 3,750
  • Joined: 06-March 01

Re: secure a .txt file

Posted 18 December 2002 - 08:58 AM

gneato, on Dec 18 2002, 05:03 AM, said:

That won't prevent people with shell access from viewing it.

nothign will prevent someone from accesing a file.. IF THEY HAVE SHELL ACCESS!
Was This Post Helpful? 0
  • +
  • -

#7 gneato  Icon User is offline

  • <title>Untitled Document</title>

Reputation: 0
  • View blog
  • Posts: 1,311
  • Joined: 03-September 01

Re: secure a .txt file

Posted 18 December 2002 - 09:21 AM

Quik, on Dec 18 2002, 09:58 AM, said:

gneato, on Dec 18 2002, 05:03 AM, said:

That won't prevent people with shell access from viewing it.

nothign will prevent someone from accesing a file.. IF THEY HAVE SHELL ACCESS!



Unix has this really cool feature called permissions.

Unfortunately, Guardian's current setup runs every single site's php with the same username (most web hosts are like this) so if one site's php script can look at a file, so can the other site's php scripts.


If you're only worried about people viewing the file from the internet, then the .htaccess is a great way.
Was This Post Helpful? 0
  • +
  • -

#8 Koenie  Icon User is offline

  • What?!

Reputation: 0
  • View blog
  • Posts: 1,313
  • Joined: 08-July 02

Re: secure a .txt file

Posted 19 December 2002 - 06:01 AM

Can my PHP scripts still work with it this way?
How does the file need to be called? just '.htacces'?
Can I make that file using something like: notepad?

Koenie
Was This Post Helpful? 0
  • +
  • -

#9 fyrestorm  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 10
  • View blog
  • Posts: 3,113
  • Joined: 04-April 02

Re: secure a .txt file

Posted 19 December 2002 - 08:54 AM

call the file .htaccess

yes your scripts can still work, if of course, they're being included in another script...

and yes, you can use notepad to create that file in
Was This Post Helpful? 0
  • +
  • -

#10 Cookie Mobster  Icon User is offline

  • nooneenooneenooonee
  • member icon

Reputation: 7
  • View blog
  • Posts: 4,730
  • Joined: 12-October 01

Re: secure a .txt file

Posted 19 December 2002 - 09:38 AM

But if you make it one a windows machine you will have to name is something other then .htaccess and upload it and change the name, windows doesn't like a filename starting with .
Was This Post Helpful? 0
  • +
  • -

#11 fyrestorm  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 10
  • View blog
  • Posts: 3,113
  • Joined: 04-April 02

Re: secure a .txt file

Posted 19 December 2002 - 09:41 AM

Cookie Mobster, on Dec 19 2002, 10:38 AM, said:

But if you make it one a windows machine you will have to name is something other then .htaccess and upload it and change the name, windows doesn't like a filename starting with .

that's odd, i have no problems making .htaccess files on a windows machine...
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1