Hi all,
In a program, I am getting an error as mentioned:
“Parse error: parse error in /home/name/public_html/hw6/read.php on line 48”.
Please refer to the program below (line 48 is in bold):
“
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html>
<head>
<title>Details</title>
</head>
<body>
<?php
constant values being put in variables so that it can be reused
$location = "../../data/datastore6.csv";
$UNLOCK = "3";
$LOCK = "2";
opening and locking the persInfo file
$filepointer = fopen($location,"r") ;
flock($filepointer,$LOCK);
reading the file and populating the array with the values in the file
$pdata = fgetcsv($filepointer, 512);
unlocking and closing the databank file
flock($filepointer,$UNLOCK);
fclose($filepointer);
#writing the file data
?>
<table >
<tr>
<h3>Organization of web site</h3>
</tr>
<?php
$pdata = array_reverse($pdata);
$org = array();
foreach($pdata as $item){
$arr = preg_split(",",$item);
array_push($org, $arr[5]);
}
#remove duplicates - find unique elements
$seen = array();
foreach ($org as $item ) {
array_push($uniq, $item) unless $seen{$item}++;
}
foreach ($uniq as $item){
print "<tr><td><a href=\"info.php?Organization=\"+$item >$item<\a><\td><\tr>";
}
?>
</table>
<p>
<a href="http://validator.w3.org/check?uri=referer"><img
src="http://www.w3.org/Icons/valid-xhtml11"
alt="Valid XHTML 1.1" height="31" width="88" /></a>
</p>
</body>
</html>
”
Any inputs to solve this are appreciated.
Thank you.
Regards,
GVPC