Hello,
I'm having some trouble displaying an HTML table when a condition is met. It appears as if the echo statment is ending prematurely and as a result some text is being sent to the brower which shouldn't. I'm trying to display the table using the echo statement using "here document" syntax. I also tried just enclosing the whole table statement in quotes. No luck. Here is the offending code.
When this is run however this is displayed in the browser.
Login Failure! Username missing
Please try again END; } ?>
So it looks like the echo tag is ending too soon. It's also worth noting that when viewing the page in my firefox browser the color coding denoting the PHP section stops after the <table border="0"> tag. So I guess the first tag to not be inclluded in the echo is the <tr> tag. Any ideas as to why this is happening? Any and all help is apprecited.
Thanks
I'm having some trouble displaying an HTML table when a condition is met. It appears as if the echo statment is ending prematurely and as a result some text is being sent to the brower which shouldn't. I'm trying to display the table using the echo statement using "here document" syntax. I also tried just enclosing the whole table statement in quotes. No luck. Here is the offending code.
Code:
<?php
if($badUserName == 1)
{
ECHO <<<END
<table border="0">
<tr>
<td align=center>
Login Failure! Username missing <br> Please try again
</td>
</tr>
</table>
END;
}
?>
When this is run however this is displayed in the browser.
Login Failure! Username missing
Please try again END; } ?>
So it looks like the echo tag is ending too soon. It's also worth noting that when viewing the page in my firefox browser the color coding denoting the PHP section stops after the <table border="0"> tag. So I guess the first tag to not be inclluded in the echo is the <tr> tag. Any ideas as to why this is happening? Any and all help is apprecited.
Thanks