Parse Error: Unexpected $end
Posted: Thu Dec 25, 2003 10:40 pm
a php newb here, I just finished basic syntax and other random sections on php.net in about a day, so I have very little experience with this particular langauge. the problem being is that I've run through my code many times over and I still can't seem to decipher why it's spitting the error "Parse Error: parse error, Unexpected End in \lib\pdatproc.php on line 41" back at me when I go to include this single function inhabitted library I wrote into some other script. If anyone could help me, I'd be appreciative. Here's the code in pdatproc.php -
Code: Select all
<?php
function poll() {
$pollFile = 'currpoll';
$pollDir = 'e:\domains\a\home\alcothology.com\databin'';
if (isset($_GETї"sub"])) {
header("location: vio.php?err=poll");
}
$fp = fopen(($pollDir.$pollFile), "r");
if (!$fp) {
$arr = array("penpen" => 0, "wraither" => 0, "either" => 0);
$tmpfp = fopen(($pollDir.$pollFile), "w");
fputs($tmpfp, implode(",", $arr);
fclose($tmpfp);
}
else {
while (($char = fgetc($fp)) != false) {
$buffer .= $char;
}
$arr = explode(",", $buffer);
fclose($fp);
}
switch ($_POSTї"poll"]) {
case 1:
$arrї"penpen"]++;
break;
case 2:
$arrї"wraither"]++;
break;
case 3:
$arrї"either"]++;
break;
default:
header("location: vio.php?err=poll");
break;
}
$tmpfp = fopen(($pollDir.$pollFile), "w");
fputs($tmpfp, implode(",", $arr));
fclose($tmpfp);
print_r($arr);
}
?> // <-- line 41