Ok, I have this code (test.html), with PHP code embed into html code. <HTML> <HEAD> </HEAD> <BODY> <?php echo dirname(__FILE__); ?> </BODY> </HTML> But does not work. (I have PHP.5.2.2)
The code has no errors, it should be working fine. Maybe you have another code which makes it not working...
You need to tell your webserver that you're using php within your html files. Assuming you;re using an Apache server, please give this a read: http://www.adamchristie.co.uk/general/putting-php-code-into-a-static-html-page/ Hope this helps, -drmike