php in html

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
cool_sni
Forum Newbie
Posts: 2
Joined: Sun Nov 01, 2009 3:09 pm

php in html

Post by cool_sni »

I am trying to embedded php into a html.

Here's the test code.

<html>
<body>
hello <BR>
<?php
echo "world is evil";
?>
</body>
</html>

I only see hello , text in echo doesn't appear on the browser.
I am not sure what is wrong with this.
Please let me know how to fix this
cpetercarter
Forum Contributor
Posts: 474
Joined: Sat Jul 25, 2009 2:00 am

Re: php in html

Post by cpetercarter »

What is your script called? It should have the termination .php (not .html) if it is to parse php.
cool_sni
Forum Newbie
Posts: 2
Joined: Sun Nov 01, 2009 3:09 pm

Re: php in html

Post by cool_sni »

I had the ext as html, I changed it to php and it works.
Thank you cpetercarter for your quick advice.
Post Reply