Processing Instructions are not shown in the browser.
<?php
is considered as an opening tag, which is only closed by ?>
; and the browser doesn't display tags themselves.
The <td>
tags, for instance, are not displayed by your browser : they are interpreted to create a table ; it's the same with the <?php
tag... But it doesn't generate any output, as the browser doesn't know what to do with it.
If you want to actually display your portion of PHP code in the HTML page, you have to encode it to HTML entities :
<
should be converted to<
>
should be converted to>
&
should be converted to&
"
should be converted to"
This way, you'll get some valid HTML, and not "things looking as HTML tags".
But note that if you want that portion of PHP code to actually be interpreted (So the query to the database is executed, and generates some output), you'll have to re-configure your webserver, so PHP code is interpreted : you should not see the PHP code on the browser-side.
That is not "browser source code". It is PHP source code that superficially looks like HTML. This is not a petty distinction, but actually fundamental if you want to understand how things work. If you are viewing that exact code in Firefox, it means you're viewing the PHP as text, not rendered HTML.
So something is wrong with your PHP server setup.