Programming, website development forum Get latest updates by RSS Follow TechnicalTalk on Twitter Follow TechnicalTalk on Facebook 
HomeSearchRecent PostsLoginRegisterContact Us

Username  
Password    
  Forgot your password?  

Pages: [1]   Go Down
 
  Email this topic  |  Print
0 Members and 1 Guest are viewing this topic.

HTML files saved with a PHP extention

 
webmaster forum
susapra  Offline
Activity
0%
 
New Poster
Posts: 9
Topics: 9
October 14, 2008, 01:44:16 AM

Would one be considered to be an idiot, or possibly even insane, if he/she has files that have no PHP coding in them whatsoever, and contunued to save and upload them as .php extentions, anyway?





« Last Edit: December 19, 2008, 02:45:01 AM by polas »
 
webmaster forum
polas  Offline
Activity
33.33%
 
Code Guru
Gender: Male
Posts: 1399
Topics: 85
WWW
October 14, 2008, 04:48:42 AM

Depends really, I think the processing overhead would be negligable. It might be useful if you wanted to start with a simple website, and have the option of extending it with PHP at a later date (and not need to change all the internal links on your site pages from html to php.)

Without trying it I dont know the answer to this - does a PHP engine allow for a .php page to simply be HTML, or does it require the boiler plating of

<?php
echo "<html>
.....
</html>";
<?>

If its the second case, then your use of " marks is limited (you can either use ' or in the cases where " are required you need it prefixed with the escape character i.e. \" - which adds a bit of extra hastle.

Mesham Type Oriented Parallel Programming Language, Free online technical support
 
webmaster forum
Activity
0%
 
Regular Coder
Posts: 51
Topics: 3
WWW
October 28, 2008, 02:00:35 PM

If it's an HTML file saved as .php, it will basically be an HTML file, just with the extension of php. Any browser still opens the file regularly.

Unofficial Rock Band Forums
 
webmaster forum
polas  Offline
Activity
33.33%
 
Code Guru
Gender: Male
Posts: 1399
Topics: 85
WWW
October 29, 2008, 03:41:51 AM

Any browser still opens the file regularly.

But does it? Surely with a .php extension the webserver would still process the file to check for php content. I would guess that when it finds no <?php tag or no php content then it would just forward the html to the end user. There is still an overhead involved in this operation, although as I noted before I would guess its negligable.

Mesham Type Oriented Parallel Programming Language, Free online technical support
 
webmaster forum
Activity
0%
 
Regular Coder
Posts: 51
Topics: 3
WWW
November 01, 2008, 05:54:53 AM

I've done it before, it seems to operate like regular HTML with me.

Unofficial Rock Band Forums
 
webmaster forum
polas  Offline
Activity
33.33%
 
Code Guru
Gender: Male
Posts: 1399
Topics: 85
WWW
November 03, 2008, 06:41:36 AM

From a user's POV does PHP operate any different to a simple HTML file? When you request a straight forward HTML document the server will send the HTML to you, when you request a PHP file the webserver will also send you the HTML (which has been generated by the PHP.) As far as the client is concerned I dont think there is really any difference (its all server side)

Mesham Type Oriented Parallel Programming Language, Free online technical support
 
  Email this topic  |  Print
Pages: [1]   Go Up
 
Jump to:  



Powered by SMF 1.1.15 | SMF © 2011, Simple Machines


Google visited last this page February 05, 2012, 09:08:25 PM