Skip to content Skip to sidebar Skip to footer

PHP Is Messing With HTML Design & Displaying Results Outside Of The HTML

I'm not to sure why this happening, I'm not 'that great' in HTML or anything and I mainly assume my issue is how I'm displaying the results...(any tips / help / or suggestions is g

Solution 1:

index.php expects the displayFood() method to return a string, which it concatenates to the HTML and then prints. But displayFood() is echoing its results instead of returning them as a string.

So you have to either change displayFood() to return a string, or change index.php to print the beginning HTML, call displayFood(), and then print the ending HTML, e.g.

echo '

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
...
<div id="breadcrumbs">
';

$poc->displayFood();

echo '

</div>
</div>





<div id="footer">
&copy 2014 - FoodManagement
</div>


</body>
</html>';

Post a Comment for "PHP Is Messing With HTML Design & Displaying Results Outside Of The HTML"