
December 21st, 2004
04:05 PM
[help] i need help protecting my flatfile data
i use an array to get my members data to list it, but when i add
<?php die("no access."); ?>
to the top of my file my arrays don't read the data right.. how can i have my arrays skip the first line or something? and also is there a better way of securing flatfile data? if so please help me out

December 21st, 2004
06:24 PM
Neversidian
Status: Offline!
ok heres a few ways. first off, get rid of the
id|name|blah
id2|name2|blah2
format and use serialize.
Next after you serialize an array put it between <?php /* and */ ?> that way the whole string is a comment. (name it a .php file obiously)
Lastly put the file in the doc_root so its not accessable via http requests.
___________________
Neverside Development Director
PHP Snippets
BigToach.com - IT WORKS, TOACHY!

December 21st, 2004
06:44 PM
thanks for the quick reply

December 21st, 2004
06:47 PM
Neversidian
Status: Offline!
or you could just use mcrypt and encrypt all your data into something fancy.
___________________
angelessme, antagonising neverside members, staff and administration since 2001.

December 22nd, 2004
09:45 AM
Neversidian
Status: Offline!
or you could do it like i said
___________________
Neverside Development Director
PHP Snippets
BigToach.com - IT WORKS, TOACHY!

December 22nd, 2004
09:57 AM
lol
___________________
For I am the one they don't like.

December 22nd, 2004
12:54 PM
i don't know how to use mcrypt or serialize since i never used either of them before, but i just read up a bit on serialize the other day mostly i like BigToach's idea with having the file in the root so no one can access it through any HTTP request, but i was wondering what if i have a vulnerability somewhere in my script and they might be able to get some sort of root access or do something malices to the root of my site if i add it in the root :/, but whatever I'm going to read some more up on serialize and go with BigToach's idea untill something does go wrong then i will try to find better methods more, but it seems that his method should work just fine

December 22nd, 2004
04:36 PM
Neversidian
Status: Offline!
If the data is really that important then i would still encrypt it even if it is outside the docroot for apache.
___________________
angelessme, antagonising neverside members, staff and administration since 2001.

December 23rd, 2004
12:04 PM
use .htaccess!
<Files "*.db">
order deny,allow
deny from all
</Files>
.db is the extension of your files
___________________
http://celerondude.com

December 23rd, 2004
01:27 PM
thinking of something witty to put here
Status: Offline!
Store your data files outside of the web root. If you're dealing with critical data I'd use a database instead.