php in ".html" documents

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • John Dunlop

    #16
    Re: php in ".html&quo t; documents

    Jerry Stuckle wrote:
    [color=blue]
    > After all - what happens if, for instance, your hosting company
    > goes under - and your new host doesn't allow you to parse .html files
    > for php?[/color]

    You give them a right good clobbering with a clue-stick??

    --
    Jock

    Comment

    • John Dunlop

      #17
      Re: php in ".html&quo t; documents

      Andrew DeFaria wrote:
      [color=blue]
      > Rename the files from .html -> .php[/color]

      If the reason for having it in the first place is still there,
      why would you take the <.html> off?
      [color=blue]
      > and adjust the corresponding links[/color]

      That's just not feasible in every case. It's impossible to
      know where all the links are - if it's on the WWW - let alone
      change each one. (HTTP redirects are a poor man's workaround
      for this mess though.)
      [color=blue]
      > - that's the proper way.[/color]

      If you did it differently, I doubt if Peggy Post would fall
      over herself to protest.

      --
      Jock

      Comment

      • Randy Jackson

        #18
        Re: php in &quot;.html&quo t; documents

        Andrew DeFaria <Andrew@DeFaria .com> wrote in news:BoKte.1427 $p%3.11209
        @typhoon.sonic. net:

        Andrew,

        You seem to feel pretty vociferously that it's a bad idea to embed php
        within .html files, or any other files for that matter. I'd like to get
        some idea as to why you feel this is such a horrible idea. For me, I'd
        just as soon end users didn't know they were looking at a php page, which
        is why I tend to use the .htaccess fix.

        So, what's your reasoning for feeling it's such a bad idea? I'd like to
        know. If there's a good reason not to do this, then I'll stop.

        --
        Randy Jackson

        Comment

        • Andrew DeFaria

          #19
          Re: php in &quot;.html&quo t; documents

          John Dunlop wrote:
          [color=blue]
          > Andrew DeFaria wrote:
          >[color=green]
          >> Rename the files from .html -> .php[/color]
          >
          > If the reason for having it in the first place is still there, why
          > would you take the <.html> off?[/color]

          Huh? What are you talking about? What's the "reason for having it in the
          first place"? Answer: Because it's a static web page! What's the reason
          for renaming it (pay attention it's not taking .html off! It's renaming
          it from .html *to* .php!)? Answer: Because it's now no longer a static
          web page but a dynamic one parsed by PHP!
          [color=blue][color=green]
          >> and adjust the corresponding links[/color]
          >
          > That's just not feasible in every case.[/color]

          Bullshit! It may not be feasible for you because you don't know how to
          use your OS or lack good tools, but it's really not that difficult.
          [color=blue]
          > It's impossible to know where all the links are[/color]

          It's called grep! Look it up!
          [color=blue]
          > - if it's on the WWW[/color]

          What's "on the WWW" mean?!? Your web site is nothing more than a
          collection of files.
          [color=blue]
          > - let alone change each one.[/color]

          It's called sed, or Perl, or dare I say PHP.
          [color=blue]
          > (HTTP redirects are a poor man's workaround for this mess though.)[/color]

          Agreed.
          [color=blue][color=green]
          >> - that's the proper way.[/color]
          >
          > If you did it differently, I doubt if Peggy Post would fall over
          > herself to protest.[/color]

          WTF are you talking about anyway?!?

          (Some people will make up any excuse they can thing of and expend so
          much energy avoiding doing the proper thing it's frigging ridiculous!)
          --
          A husband is someone who takes out the trash and gives the impression he
          just cleaned the whole house.

          Comment

          • Andrew DeFaria

            #20
            Re: php in &quot;.html&quo t; documents

            Randy Jackson wrote:
            [color=blue]
            > You seem to feel pretty vociferously that it's a bad idea to embed php
            > within .html files, or any other files for that matter. I'd like to
            > get some idea as to why you feel this is such a horrible idea. For me,
            > I'd just as soon end users didn't know they were looking at a php
            > page, which is why I tend to use the .htaccess fix.
            >
            > So, what's your reasoning for feeling it's such a bad idea? I'd like
            > to know. If there's a good reason not to do this, then I'll stop.[/color]

            Why do you name a file .html? I mean why not choose the extension of
            ..foo? Why does Windows name executables .exe and Excel files .xls?
            Simple, to indicate and distinguish that this file is different and or
            processed differently than other files. IOW there's a reason and that is
            indeed the reason. There really doesn't need to be another reason now
            does there?

            However the server will also be taxed in to parsing all .html files
            looking for executable PHP code if you configure it that way. Seems like
            a waste of processing time to me. There are also things such as "server
            parsed html" normally named .shtml. Why is that? I mean why not make all
            ..html files the same as .shtml files? Well as the docs say you don't
            want the server have to parse each html file as if it were a .shtml file
            - it's wasteful. How then is this different for PHP?

            And there may be some additional exposure to a security problem by doing
            this (This I'm not as sure about - IOW it's probably harmless from a
            security perspective).

            Finally I fail to see why there is such push to use a sledge hammer
            approach to fix a problem that really has a quite definite direction for
            a proper solution. Is renaming a few files that hard to do? Is finding
            links to those pages that hard to do? A simple script run over the set
            of .html files seems like probably something much simpler of a script
            than most scripts that people are writing here in PHP pages! Come on
            people, can't you program? If not then what are you doing in a PHP
            newsgroup?!?

            The time spent arguing why renaming the files involved from .html ->
            ..php and finding and adjusting any links to it properly is probably a
            lot less than the time, energy and effort spent here justifying why a
            sledge hammer approach is preferred. It always amazes me how people
            spend more energy avoiding a task then actually doing it!
            --
            I used to have a handle on life, then it broke.

            Comment

            • www.douglassdavis.com

              #21
              Re: php in &quot;.html&quo t; documents

              I know you probably don't care to hear this but:

              This could also slow down server performance a little, as every .html
              file will have to be parsed to see if it contains php.

              --
              PHP Stuff:


              Comment

              • Malcolm Dew-Jones

                #22
                Re: php in &quot;.html&quo t; documents

                Andrew DeFaria (Andrew@DeFaria .com) wrote:

                : John Dunlop wrote:

                : > Andrew DeFaria wrote:
                : >

                : >> and adjust the corresponding links
                : >
                : > That's just not feasible in every case.

                : Bullshit! It may not be feasible for you because you don't know how to
                : use your OS or lack good tools, but it's really not that difficult.

                Well lets see, my customer inserts the CD they bought a couple of years
                ago and clicks on the help button that says - "go here to look for
                updates"

                I'm afraid I'm not clear which tool will update my customers CD.

                (Oh yes I forgot, according to you that link isn't "golden", my customers
                should not expect to be able to reach the relevant section of my web site
                from the link on the CD they bought last year.)


                : > It's impossible to know where all the links are

                : It's called grep! Look it up!

                I'm not acquainted with that version of grep. Better keep it out of the
                hands of muggles though, it sounds like a powerful tool, traversing school
                news letters, business cards, and government pamphlets in its quest to
                hunt down the places your web addresses are mentioned.


                --

                This space not for rent.

                Comment

                • Malcolm Dew-Jones

                  #23
                  Re: php in &quot;.html&quo t; documents

                  www.douglassdavis.com (douglass_davis @earthlink.net) wrote:
                  : I know you probably don't care to hear this but:

                  : This could also slow down server performance a little, as every .html
                  : file will have to be parsed to see if it contains php.

                  Which is why I said "an area" of the server might be configured to this so
                  that only some sets of files are impacted.

                  And if many of those html files contain php then they are going to be
                  scanned anyway.

                  And unless your server has a performance issue then the processing is
                  irrelevent. The old adage about optimizing after identifying the
                  performance problems applies here as elsewhere. If your cpu is 20% busy
                  then it makes little difference if things take twice as many cycles, as
                  long as the over all response is still ok for the end user.

                  And if performance is a problem then perhaps those pages should be
                  pre-generated on a timely schedule instead of being truly dynamic - and of
                  course then we'll have to change the names back to html because they are
                  no longer quite so dynamic as before, and we'll end up having the
                  identical discussion but in reverse.

                  --

                  This space not for rent.

                  Comment

                  • Malcolm Dew-Jones

                    #24
                    Re: php in &quot;.html&quo t; documents

                    Andrew DeFaria (Andrew@DeFaria .com) wrote:
                    : Randy Jackson wrote:

                    : > You seem to feel pretty vociferously that it's a bad idea to embed php
                    : > within .html files, or any other files for that matter. I'd like to
                    : > get some idea as to why you feel this is such a horrible idea. For me,
                    : > I'd just as soon end users didn't know they were looking at a php
                    : > page, which is why I tend to use the .htaccess fix.
                    : >
                    : > So, what's your reasoning for feeling it's such a bad idea? I'd like
                    : > to know. If there's a good reason not to do this, then I'll stop.


                    : And there may be some additional exposure to a security problem by doing
                    : this (This I'm not as sure about - IOW it's probably harmless from a
                    : security perspective).

                    Yes, .html files as php is a security concern because it's easier for
                    someone to install a cgi script without your knowledge. A hacker could
                    add a <?php section to your home page and you might not know for a long
                    time that it was now doing something on the side everytime a person
                    visited your site. A legitimate but unprivileged user could upload an
                    html file and not even realize it is a script - i.e. it's just plain
                    harder to control since the type of file is not as obvious to the
                    administrators.

                    But the reverse is just as likely to be true.

                    A .php file is a target for certain hackers because it shows the site is
                    running cgi-like scripts, whereas a site that appears to be static has
                    less obvious reasons and hooks for a hacker to check. The .php extension
                    also shows what type of programming is being used, just like the extension
                    ..asp shows it's an NT server with asp capabilities.

                    There is no good reason to give out this kind of information any more than
                    you have to.

                    In either case, if you are able to run scripts at all then security is
                    more of a concern than if your web server refuses to run them.

                    --

                    This space not for rent.

                    Comment

                    • Daniel Tryba

                      #25
                      Re: php in &quot;.html&quo t; documents

                      Malcolm Dew-Jones <yf110@vtn1.vic toria.tc.ca> wrote:[color=blue]
                      >
                      > : >> and adjust the corresponding links
                      > : >
                      > : > That's just not feasible in every case.
                      >
                      > : Bullshit! It may not be feasible for you because you don't know how to
                      > : use your OS or lack good tools, but it's really not that difficult.
                      >
                      > Well lets see, my customer inserts the CD they bought a couple of years
                      > ago and clicks on the help button that says - "go here to look for
                      > updates"
                      >
                      > I'm afraid I'm not clear which tool will update my customers CD.[/color]

                      Ahhhh, never seen this happen before.... aren't we lucky dead links
                      don't exist :)

                      If you communicate such URL you should keep in mind that the
                      implementation on the server could change over time. But carefully
                      chosen it could survive for a long time eg don't link to the index
                      "file", link to the "directory" instead. That solves a move from a php
                      based httpd with /index.php to eg an ASP based machine with
                      /default.asp. If possible don't use extensions, let the httpd figure out
                      what to send. Some servers support url rewriting make moves transparant
                      for the client. Or simply use clientside solutions to point to the new
                      location.

                      Comment

                      • John Dunlop

                        #26
                        Re: php in &quot;.html&quo t; documents

                        Andrew DeFaria wrote:
                        [color=blue]
                        > John Dunlop wrote:
                        >[color=green]
                        > > Andrew DeFaria wrote:
                        > >[color=darkred]
                        > > > Rename the files from .html -> .php[/color]
                        > >
                        > > If the reason for having it in the first place is still there, why
                        > > would you take the <.html> off?[/color]
                        >
                        > Huh? What are you talking about? What's the "reason for having it in the
                        > first place"? Answer: Because it's a static web page![/color]

                        a text/html file, Shirley?
                        [color=blue]
                        > What's the reason for renaming it (pay attention it's not taking .html
                        > off! It's renaming it from .html *to* .php!)?[/color]

                        I misunderstood you. When you wrote 'from .html -> .php', I
                        got the impression that you meant <.html> no longer occurs as
                        a filename extension, that you replaced it with <.php>. (In
                        fact I still have trouble not reading it as that.)

                        Skipping to the next bit...
                        [color=blue][color=green][color=darkred]
                        > > > and adjust the corresponding links[/color][/color][/color]

                        [so now we've moved from talking about filenames to talking
                        about addresses]
                        [color=blue][color=green]
                        > > That's just not feasible in every case.[/color]
                        >
                        > Bullshit![/color]

                        We're talking cross purposes then. I'm talking the whole wide
                        world, you're talking local filesystem, and I expect you'll
                        agree they're two very different things!

                        --
                        Jock

                        Comment

                        • Michel

                          #27
                          Re: php in &quot;.html&quo t; documents

                          [Outlook]..... is also an answer to a question... I think you know what it
                          is.
                          ;-)

                          "John Dunlop" <usenet+2004@jo hn.dunlop.name> wrote in message
                          news:MPG.1d2268 dfec7850a98969a @news.ntlworld. com...[color=blue]
                          > Michel wrote:
                          >[color=green]
                          > > Which was an answer to a question that wasn't asked.[/color]
                          >
                          > which is alright in my book!!
                          >
                          >
                          > 'top posting'
                          >
                          > [just for you, Michel, that was another answer to a question
                          > that wasn't asked - can you tell what it is yet?]
                          >
                          > --
                          > Jock[/color]


                          Comment

                          • John Dunlop

                            #28
                            Re: php in &quot;.html&quo t; documents

                            Michel wrote:
                            [color=blue]
                            > [Outlook]..... is also an answer to a question... I think you know what it
                            > is.[/color]

                            An old joke, slightly adapted here:

                            'Outlook' is not the answer. 'Outlook' is the question, and
                            the answer is 'no'.

                            ['QuoteFix' yet another, but now the questions are getting
                            harder to guess]
                            [color=blue]
                            > ;-)[/color]

                            Of course!

                            --
                            Jock

                            Comment

                            • Michel

                              #29
                              Re: php in &quot;.html&quo t; documents

                              As long as top quoted lines show up first, without me having to scroll all
                              the time.... the answer applies to a question I am asking you....

                              LoL.... that was a good one b.t.w. ;-)

                              "John Dunlop" <usenet+2004@jo hn.dunlop.name> wrote in message
                              news:MPG.1d24f5 33b41464b298969 f@news.ntlworld .com...[color=blue]
                              > Michel wrote:
                              >[color=green]
                              > > [Outlook]..... is also an answer to a question... I think you know what[/color][/color]
                              it[color=blue][color=green]
                              > > is.[/color]
                              >
                              > An old joke, slightly adapted here:
                              >
                              > 'Outlook' is not the answer. 'Outlook' is the question, and
                              > the answer is 'no'.
                              >
                              > ['QuoteFix' yet another, but now the questions are getting
                              > harder to guess]
                              >[color=green]
                              > > ;-)[/color]
                              >
                              > Of course!
                              >
                              > --
                              > Jock[/color]


                              Comment

                              Working...