unusual error $end

Untitled Document <?php printgreeting(); printdice(); printform();

function printgreeting(){
global $numpetals;
$guess=filter_input(INPUT_POST,“guess”);
$numpetals=filter_input(INPUT_POST,“numpetals”);

if(!filter_has_var(INPUT_POST,"guess")){
	print "<h3>Welcome</h3>";
}else if($guess==$numpetals){
	print "<h3>You got it</h3>";
}else{
	print<<<HERE
	from last 
	<p>
	you giessed: $guess
	</p>
	 the correct answer is : $numpetals
	</p>
	HERE;
}

}

function printdice(){
global $numpetals;
print “

New Roll:\n”;
$numpetals=0;
$die1=rand(1,6);
$die2=rand(1,6);
$die3=rand(1,6);
$die4=rand(1,6);
$die5=rand(1,6);
$die6=rand(1,6);

print "<p>\n";
showdie($die1);
showdie($die2);
showdie($die3);
showdie($die4);
showdie($die5);
showdie($die6);
print "</p>\n";

calcnum($die1);
calcnum($die2);
calcnum($die3);
calcnum($die4);
calcnum($die5);
calcnum($die6);

}

function showdie($value){
print<<<HERE
die:$value
HERE;
}

function calcnum($value){
global $numpetals;
switch($value){
case 3:
$numpetals+=2;
break;
case 5:
$numpetals+=4;
break;
}
}

function printform(){
global $numPetals;
print <<<HERE

How many petals around the rose?


<fieldset>
<input type = "text"
	name = "guess"
	value = "0" />
<input type = "hidden"
	name = "numPetals"
	value = "$numPetals" />
	<br />
<input type = "submit" />
</fieldset>
</form>
HERE;

}
?>

when i run this program in my browser i get the error:
Parse error: syntax error, unexpected $end in F:\xampp\htdocs\newgame.php on line 112
and line 112 is
so where is the error

Hi there,

Try moving all of your “HERE;” final statements to the beginning of the line (no tabs or spaces before them)

Thx for ur reply. I tried your remedy…now it gives the error:
Parse error: syntax error, unexpected T_SL in F:\xampp\htdocs\newgame.php on line 68

which is the next line to “showdie($value)” i.e its showing error in print<<<HERE

Sponsor our Newsletter | Privacy Policy | Terms of Service