Please I have a discussion with a Hosting service, tell me if that affirmation is true:
"The .htm extensions means simple static HTML file and server doesn't process PHP code inside this file and doesn't accept POST request related to such files.
If you want your PHP code works you need to change file extension to .php "
If I want to execute php code inside a html page, does it work?
the php code is executed for the php module and the htm for html "module" It is right?
Thanks
Offline


This sounds very basic. If you want to write PHP, you must learn the basics first!
Host is right, but technically you can execute PHP script in any extension - say .jsp or .asp. To do so, you must have access to the server configuration file which you will not get in a shared environment.
If you are hosting on a shared server, you must try doing normal stuff.
Offline
PHP code is not technically executed inside an HTML document. PHP is a programming language, HTML is a markup language, and the two should not cross.
To accurately implement a site using php, you shouldn't need to have an HTML or HTM file! Your files should be PHP (unless you need others such as CSS and JAVASCRIPT etc). Each php file should begin with a php tag, and end with a php closing tag. Only one of each. I see many websites which just open php tags, run the code, echo the html and close the php tags - many do this multiple times in one document, which is horrendus programming and indicates the user does not know what's going on.
To accurately answer your query - you should have a php file with functions for generating html code. You can then make a function which generates a header (including doctype, <html>, <head> etc), and functions such as tag (to do <p>Hello!</p>), starttag (to do <p>), endtag (</p>) and for singletons (<br/>).
This will eliminate the need for a html or htm file, is complete valid php, and actually saves the preprocessor dealing with the markup language, then passing it to a browser to display on the page. Instead, it deals with the functions, and the markup language is only analysed by the browser. The correct way to program. This also guarantees your html tags are always correct 
Offline