Banner

Sponsor

Login


Welcome Back!
Guest
Guest

Register

Lost your password?

99 users online



[help] i need help protecting my flatfile data

[help] i need help protecting my flatfile data

Currently viewing this thread: 1 (0 members and 1 guests)


Page 1 out of 2
nertman

nertman

lurker
Status: Offline!

[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:


<?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

BigToach

BigToach

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!

nertman

nertman

lurker
Status: Offline!

thanks for the quick reply

angelessme

angelessme

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.

BigToach

BigToach

Neversidian
Status: Offline!

or you could do it like i said

___________________

Neverside Development Director
PHP Snippets
BigToach.com - IT WORKS, TOACHY!

venox

venox

Status: Offline!

lol

___________________

For I am the one they don't like.

nertman

nertman

lurker
Status: Offline!

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

angelessme

angelessme

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.

CDude

CDude

nothing
Status: Offline!

use .htaccess!

<Files "*.db">
order deny,allow
deny from all
</Files>

.db is the extension of your files

___________________

http://celerondude.com

Rad

Rad

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.

Page 1 out of 2
Quick Jump:

Main Navigation


Site & Graphic Design by Aeon Tan
Developed by Jeremie Pelletier & Scott Roach


NeverAPI generated this page in 0.0086 seconds.