ok im in desperate need of getting this done. i have the following text file:
[Users]
Jack= Test A
Pete=Test B
Rose=test c
[Users2]
Jack2=testpp
Pete2=Test B
Rose2=test c
and heres my php file (not the it parses it through the url):
<?php
$fp=fopen("$file","rb");
$contents=fread($fp,filesize($file));
$explode=explode("$section]", $contents);
echo $explode[1];
$pregit=preg_match("/$key=./",@$explode[1],$preg);
echo $pregit;
$explode=explode("=", $preg[0]);
if($explode[1]=='')
{
echo $default;
}else
{
echo $explode[1];
}
?>
ok here is the example of the url:
http://localhost/profile/ps.php?file=test.txt§ion=Users2&key=Jack&default=ee
now here's what happens in the text file it should match Jack but it there is no jack in the section it is looking in so it should return default but instead it is using jack2. any ideas? all help is appreciated..