It will not. If the extension is .htm or .html, it will not work. Change the extension of the file to .php and shurely it will work.
Depending on how much control you have over your server, you can tell it to run .html file thru the php engine.
Open the .htaccess file in the folder where you have your site, then add: RemoveHandler .html .htm AddType application/x-httpd-php .php .htm .html Code (markup): Then just use php as normal, for example: <?php if ($user = 'rcajht') { echo 'welcome rcajht to your website'; } else { welcome to our website } PHP: Hope that Helps }
Read Bunk's post. It's possible, but you have to alter the apache config just a little bit. If you're going to do a lot with PHP and it's not just one simple little code (or even if it is), renaming your file from like index.html to index.php might be a good idea. That way if you ever move your server, or have someone looking at your code, it's a bit smoother and causes less confusion.