Hi
I was told before that having the flat file as a php file wouldn't help if it was unparsed but I thought that parsing it wrongly might add protection. I did some tutorials on how to get the flat file open and into an array and came up with this code:
First of all, make the file "read.php" (or whatever you like)
<?
$Lines = file("data.php");
foreach($Lines as $Key => $Val)
{
$Data[$Key] = explode("|", $Val);
}
for($K = 0; $K < 1; $K++) {
echo '';
}
for($K = 1; $K < sizeof($Lines); $K++)
{
echo '<p>';
echo 'info: '.$Data[$K][0].'<br>';
echo 'moreinfo: '.$Data[$K][1].'<br>';
echo '</p>';
}
?>
You can see that the file that is being opened is called data.php
Here is data.php
<?php|phpdata
data1|data2
data3|data4
When you run read.php it will omit the "<?php|phpdata" line and read the rest of the lines.
When you try and directly access data.php you will get an error.
I'd appreciate your feedback to see whether this is a viable security option.