Page 1 of 1

Flat file script

Posted: Fri Mar 10, 2006 6:06 pm
by Smackie
hello i created a flat file script and well i have alil problem now here is the script

Code: Select all

<?
$Lines = file("data.txt");

foreach($Lines as $Key => $Val) 
{
   //explode that data into a new array:  
   $Data[$Key] = explode("||", $Val);
}

for($K = 0; $K < sizeof($Lines); $K++) 
{ 
   echo '<p>';   
   echo 'Rank: '.$Data[$K][0].'<br>'
   echo 'Callsign: '.$Data[$K][1].'<br>'
   echo 'Duty: '.$Data[$K][2].'<br>'
   echo '</p>';
}
?>
and i get this error
Parse error: syntax error, unexpected T_ECHO, expecting ',' or ';' in /home/gnsf/public_html/test/home.php on line 14
can someone help thank you
Smackie

Posted: Fri Mar 10, 2006 6:08 pm
by alex.barylski
Look at the end of youe echo your missing semi-colons...

Posted: Fri Mar 10, 2006 6:14 pm
by Smackie
thank you lol i been looking at the binary in school all week lol and yeah lol

Posted: Sat Mar 11, 2006 12:09 am
by Smackie
ummm i have a question what should the main.php page and the data.php page should be for CHMOD

Posted: Sat Mar 11, 2006 10:15 am
by Smackie
Can someone tell me why im just getting a blank on this script? it should come up with like a place to enter a rank, a callsign, and a duty but its not

Code: Select all

<?
$Lines = file("data.txt");

foreach($Lines as $Key => $Val) 
{
 //explode that data into a new array: 
$Data[$Key] = explode("||", $Val); } for($K = 0; $K < sizeof($Lines); $K++) 
{    

   echo '<p>';    
   echo 'Rank: '.$Data[$K][0].'<br>';
   echo 'Callsign: '.$Data[$K][1].'<br>'; 
   echo 'Duty: '.$Data[$K][2].'<br>';
   echo '</p>';
} 
?>

Posted: Sat Mar 11, 2006 10:25 am
by feyd