I have a .php file which renders a webpage and works as intended. It contains the following chunk:
<?php
}
else
{
openConnection();
$userid = $_SESSION["userid"];
$loggedinphrase = getLoggedInPhrase($connection, $userid);
print "<p>\nYou are currently <span class=\"important\">" . $loggedinphrase . "</span>.\n</p>";
mysql_close($connection);
}
?>
I am copying the entire contents of this PHP file over to a different HTML file. In particular, I'm sticking it right after <h2>Overview</h2> in this templatefile.
But I get this on the webpage:
\nYou are currently " . $loggedinphrase . ".\n
"; mysql_close($connection); } ?>
Why could this be happening?
<?php echo "Hello World!"; ?>and it didn't actually load. I know my server can handle php because .php files work fine. Why isn't PHP working within an HTML file for me?