Page 1 of 1

code to secure .txt / .dat file?

Posted: Thu Oct 02, 2003 5:39 am
by mesz

Code: Select all

<?php
<?php 
session_start();
if ($permission=="yes") { 
?> 
[b]T E X T[/b]<?php }else{ ?> 
you are not allowed to access this page 

<?php } ?>
?>
the above code is what I would typically use to keep a casual user away from the content of a php page.....
but
how do I secure a text file?

Posted: Thu Oct 02, 2003 6:02 am
by Nay
If you want to protect them from direct access, then take a look at:

viewtopic.php?t=12878

-Nay

Posted: Thu Oct 02, 2003 6:51 am
by Derfel Cadarn
I was just about to suggest one of the sollutions when my computer crashed 8O
And now I saw that my suggestion is already in the posting mentioned in Nay's answer:
- hide the file in an not-accessible dir and
- indlude it.

Posted: Thu Oct 02, 2003 7:00 am
by mesz
Cheers ( once ) again for your help.
I opted for the . htaccess file
I understand that this is not the most ' complex ' answer to go for, but it does kill prying eyes dead.