adamriley Posted April 19, 2010 Share Posted April 19, 2010 any one care to tell me why i get this error please ---------------------- add.php ------------------------------ <?php //get the q parameter from URL $Number1=$_GET["num1"]; $Number2=$_GET["num2"]; // adds $add_them = $Number1 + $Number2; $minus_them = $Number1 - $Number2; $times_them = $Number1 * $Number2; // add them all $all_together_echos_no_html = <<<all $add_them </br> $minus_them </br> $times_them</br> all; // $questions = <<<questions $Number1 + $Number2 </br> $Number1 - $Number2 </br> $Number1 "times" $Number2 </br> $Number1 "Devide" $Number2 </br> questions; // $html = <<<html_of_page <html> <head> <title></title> </head> <body> <h2><b><u><center>Questions</b></u></center></h2> <?php echo $questions ?> <h2><b><u><center>Answers</b></u></center></h2> <?php echo $all_together_echos_no_html ?> </body> </html> html; echo $html_of_page; ?> Link to comment https://forums.phpfreaks.com/topic/199040-parse-error-syntax-error-unexpected-end-in-cxampphtdocsw3schoolsnumber/ Share on other sites More sharing options...
Mchl Posted April 19, 2010 Share Posted April 19, 2010 You used wrong closing identfier for last heredoc $html = <<<html_of_page <html> <head> <title></title> </head> <body> <h2><b><u><center>Questions</b></u></center></h2> <?php echo $questions ?> <h2><b><u><center>Answers</b></u></center></h2> <?php echo $all_together_echos_no_html ?> </body> </html> html_of_page; echo $html; Link to comment https://forums.phpfreaks.com/topic/199040-parse-error-syntax-error-unexpected-end-in-cxampphtdocsw3schoolsnumber/#findComment-1044751 Share on other sites More sharing options...
adamriley Posted April 19, 2010 Author Share Posted April 19, 2010 Thanks i mixed them up Link to comment https://forums.phpfreaks.com/topic/199040-parse-error-syntax-error-unexpected-end-in-cxampphtdocsw3schoolsnumber/#findComment-1044752 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.