General Community > Scripting Help
PHP include Statements?
MrPhil:
A .php file can have any amount of HTML (the stuff outside of <?php and ?>) and any amount of PHP (the stuff inside <?php and ?>). The server will go through the file, looking for <?php and feed the PHP code it finds to the PHP processor. On the other hand, .htm or .html doesn't get any server-side processing. It's simply tossed over the transom to the browser, as-is.
If you see sites with pages that are .html but it seems to be doing PHP processing, one of two things probably is going on:
* The server is configured to feed .html to the PHP processor anyway (treat .html as .php would be).
* SEO is in use to hide the true language used, and make the whole site look like it's HTML.In both cases, the purpose may be to conceal how the page is implemented, and hopefully reduce the chance of hacks targeted to that language, or because the implementation may change (PHP on a Linux server this year, ASPX on a Windows server next year) and the owner doesn't want all the bookmarks and search engine listings to suddenly go bad.
ApplianceJunk:
Very interesting to know, thanks!
Navigation
[0] Message Index
[*] Previous page
Go to full version