Re: PHP-Yes, HTML-No --- Why?



d wrote:
Hmmmm... That logic doesn't even make sense. You can have a Perl script or a .exe file that "spits out" just text. Should such files have a .txt extension?!? The .html signifies that the file contains HTML - and pretty
much only HTML. A php script contains both HTML and PHP code so technically speaking it's not just HTML.
The user is getting a file from your web server, an HTML file, and it has an extension of something other than HTML.
Hmmm...
jupiter:wget http://defaria.com
--07:50:13--  http://defaria.com/
           => `index.html'
Resolving defaria.com... 192.168.1.103
Connecting to defaria.com|192.168.1.103|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]

    [ <=>                                 ] 9,689         --.--K/s            

07:50:13 (7.06 MB/s) - `index.html' saved [9689]

Yet the index file on my site is index.php.

So surely you must mean they "get" it with a browser and thus the URL has a .php at the end of it. Oh horrors! What if the kids see it! You're sick man!
Having your files named due to your servers requirements is a bit selfish, in my opinion.
Hmmm.... "Doesn't look good" and "selfish". Persuasive arguments indeed! Would you rather that the server change the URL typed in from ..php -> .html and then be pointing at a file that doesn't exist or is it you want the server to have to parse each and every file for every thing known and thus slow down everybody - just so you can see ..html instead of .php? A foolish argument at best.
Not to mention it makes websites look terrible.
Oh yes looks horrible - how have we stood for this for so long! It's a crying shame!
Why do you think that browsers shouldn't determine the contents of the file from it's extension? Truth is it does, multiple times over in many, many different occasions. Ever hear of mime.types? Ever actually configure
an Apache server?
header sent.
Content headers are not always sent. For example, an ftp:// style URL doesn't send them I believe. There are many other reasons for a mime.types file. The point (which you missed) was that many things, processes, applications etc make use of file extensions for the purposes of determining what type a file is - and rightly so.
Of course I have configured apache servers. I don't want to get into a pissing match here,
Well you started first by pissing and moaning about URLs not having ..html extensions...
but please rest assured I've configured some massive apache setups on some very expensive hardware for some very big clients paying very good money :) That's all I'll say about that, as it's a vulgar subject at best.
I hope you weren't configuring them as per your personal likes and dislikes but instead were configuring them as per the customer requirements and for speed, etc.
Or, if we have properly-coded modules for our web servers.
Define proper! I think they are proper right now. They work as they are stated to work and they take into account very real world limitations and constraints and don't waste time on essentially cosmetic crap!
We're not hosting things on 386s any more.
Who said we were? Not I!
We have gigahertz of power to play with,
Yes so that means we must waste time? You're logic is strange indeed sir.
and checking a file for "<?" or "<?php" funnily enough doesn't take a cluster of supercomputers. It's not rocket science :)
No, implementing an algorithm to do that is not difficult - it's wasteful. Should the server likewise scan through a 30 Meg mp3 file? A 7 meg bmp file? What if the server find such strings in a <pre> section or in a .txt file? Lots of considerations that you don't even seem to acknowledge as you are probably have never designed and written software before. Again there are very good reasons not to do this and you offer up only emotional "Well it doesn't look right" reasons which quite frankly carry very little to 0 weight.
--
Music is the art which is most nigh to tears and memory. - Oscar Wilde


Relevant Pages

  • Re: HELP - Cant change Include Path
    ... Here is my php.ini path for the php.ini in both php and sql dirs: ... which did work on the remote linux server and sent me some mail ... Although my gmail acct picked the mail up as ... an attachment instead of as html - but gmail is really wierd about ...
    (comp.lang.php)
  • Re: PHP-Yes, HTML-No --- Why?
    ... You are arguing to have .html at the end of every URL even if the file contains PHP or another scripting language. ... We are talking about web servers, not FTP servers. ... I never said the server should parse MP3 files or whatever, ...
    (comp.lang.php)
  • Re: PHP-Yes, HTML-No --- Why?
    ... they don't have any PHP in them. ... which does indeed do away with extensions altogether. ... I hit two identical servers, one set to parse html via php, and one ... html-parsing server being quicker, ...
    (comp.lang.php)
  • Re: PHP-Yes, HTML-No --- Why?
    ... When I do generate them, I can still have PHP providing them, AND keep the .mp3 as an extension, because of the tools I use on my site. ... The site is a whole - asking someone to ignore the mess in the address bar because "it's just the way the web server works" is a bit silly. ... The .html signifies that the file contains HTML - and pretty ... mean they "get" it with a browser and thus the URL has a .php at the end of it. ...
    (comp.lang.php)
  • Re: How to do a post back when user press enter.
    ... It is hosted on a web server, ... the client browser, which is designed to read and interpret HTML. ... UI, via the event handler. ...
    (microsoft.public.dotnet.framework.aspnet)