pocobueno1388 Posted November 12, 2006 Share Posted November 12, 2006 For some reason my print() isn't working correctly. When I print a large amount of text to the screen I use this:[code]print<<<HEREtext text blah blahHERE;[/code]Here is the code I am having trouble with:[code]<?phpprint<<<HERE<TABLE class='main' cellspacing=5><TD class='main' align='center'> $row4[image_url]<br> <b>$row3[item_name]</b><br> <b>Uses:</b> $row3[uses]<p> <i>$row4[description]</i><p></td><TR class='main' align='center'><form action="inventory.php?itemID=$item" method="post"><td>HERE; ========================================//NOT ENDING! if ($row3[tack_type] != no){ echo "<a href='inventory_old.php?itemID=$item&action=equip'>equip $row3[item_name]</a><br>";} else { echo "<a href='inventory_old.php?itemID=$item&action=use'>Use $row3[item_name]</a><br>";} print<<<HERE <a href="inventory_old.php?itemID=$item&action=shop">Put into your shop</a><br> <a href="inventory_old.php?itemID=$item&action=delete">Discard</a><br> </td></form></table>HERE;?>[/code]and this is what it displays to the screen:[tt]HERE; if (collar != no){ echo "equip Brown Collar"; } else { echo "Use Brown Collar"; } print<<Put into your shopDiscard[/tt]its almost as if the print isn't ending with the HERE;Any help is greatly appreciated XD Thanks. Link to comment https://forums.phpfreaks.com/topic/27040-problem-with-ending-a-print-solved/ Share on other sites More sharing options...
trq Posted November 12, 2006 Share Posted November 12, 2006 Try...[code=php:0]<?phpprint <<<HERE<TABLE class='main' cellspacing=5><TD class='main' align='center'> {$row4['image_url']}<br> <b>{$row3['item_name']}</b><br> <b>Uses:</b> {$row3['uses']}<p> <i>{$row4['description']}</i><p></td><TR class='main' align='center'><form action="inventory.php?itemID=$item" method="post"><td>HERE;[/code]Notice the space after print? You might also notice I fixed all your errors with regard to array indexees not being in quotes. Link to comment https://forums.phpfreaks.com/topic/27040-problem-with-ending-a-print-solved/#findComment-123656 Share on other sites More sharing options...
pocobueno1388 Posted November 13, 2006 Author Share Posted November 13, 2006 That seemed to get rid of that error, but now the print below that one won't close.[tt]Parse error: syntax error, unexpected T_SL in /home/colin/public_html/inventory_old.php on line 193[/tt]Here is the code to that part:[code]<?phpprint <<<HERE //=============Line 193 <a href="inventory_old.php?itemID=$item&action=shop">Put into your shop</a><br> <a href="inventory_old.php?itemID=$item&action=delete">Discard</a><br> </td></form></table>HERE;?>[/code] Link to comment https://forums.phpfreaks.com/topic/27040-problem-with-ending-a-print-solved/#findComment-123706 Share on other sites More sharing options...
pocobueno1388 Posted November 13, 2006 Author Share Posted November 13, 2006 I fixed it. Link to comment https://forums.phpfreaks.com/topic/27040-problem-with-ending-a-print-solved/#findComment-123708 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.