How do I this cgi working in PHP??
sub display {
open (DAVE,"$data"); @=<DAVE>; close DAVE;
$daveentry=''; foreach $daveentry (@) { ($num,$name,$address,$town,$postcode,$none)=split(/||/,$daveentry);
cheers
One version is:
// Try to opene the file and read it into an array called $aDave if ($aDave = file($data)) { // File opened ok, proceed // Print all the elements of the array foreach ($aDave as $sLine) { echo $sLine; }; } else { // File open failed echo "Could not open file ".$data; };
You might want to read the manual too.