You are viewing this site as a guest. Join our community to get your questions answered and share knowledge. Active members may advertise and ask for a website critique.

check if PHP is parsed in HTML files

.

[In Windows you can right-click on the link above to save the file - on Mac it is control-and-click, right?]

It is common these days to embed a bit of PHP code inside an HTML page.

However not all hosting companies enable this.

This file embeds the phpinfo() function in an HTML page - so if you can parse PHP code in HTML you will see the PHP info page...

<html>
<head>
  <title> phpinfo() html </title>
</head>
<body>
<?php phpinfo(); ?>
</body>
</html>

In case it fails, here is some basic info about configuring .htaccess

When PHP is run as CGI alternative settings may work

Or you can ask your hosting support to help you out - but be prepared for the inevitable comment, "Why do you need to put PHP in an HTML file? Why don't you just use the .php extension?" Reply: "Because it is a standard practice in web development."

In fact, the TWF server fails the test on the attached file...

AttachmentSize
phpinfo.html111 bytes