user3511259 user3511259 - 1 month ago 8
HTML Question

PHP inside HTML doesn't work

I just want to know why does this HTML file shows nothing:


  • I'm running it on a web server

  • Name of the file is index.php

  • I've fixed the
    <?
    issue but it still doesn't work



Here's the code:

<html>
<head>
</head>
<body>
<?php
echo "hdfguhbgzusgdfghdhhfgh";
?>
</body>
</html>

Answer

You should make sure that following is given:

  • php on your server

  • files has to end with ".php"

  • use open Tag <?php and not <?

Than it should work.

For a definity solution you should provide further information.

Comments