OK really stupid question now.

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

    OK really stupid question now.

    Sorry guys, stupid question....

    Am no programming expert and have only just started using php for
    creating dynamic news pages.

    Then I see a dynamic website without the php extension.

    Daily car news, reviews, videos, photo galleries, road tests, blogs, motor shows, used car buying guides, advice and features from the independent UK car guide.


    It has the html extension that loads the required page dynamically.

    I thought html pages could not be dynamic. How is this done??

    Thanks

    Alec
  • Alec

    #2
    Re: OK really stupid question now.

    Michael thanks for the reply...

    So I should stick to standard php then... Thats suits me :-)

    By the way, what advantage can be gained by using this other
    method???

    Cheers

    Alec

    Comment

    • Ivan Marsh

      #3
      Re: OK really stupid question now.

      On Fri, 22 Aug 2008 08:11:35 -0700, Alec wrote:
      Michael thanks for the reply...
      >
      So I should stick to standard php then... Thats suits me :-)
      Google "clean urls" if you want more control over what's in the address
      bar.
      By the way, what advantage can be gained by using this other method???
      The only advantage is facilitating laziness. You can set up a webserver to
      process any file extension through any server-side process but that means
      all files are being run through the processor instead of just the files
      that have scripting language in them. It's drastically increasing server
      load unnecessarily.

      --
      I told you this was going to happen.

      Comment

      • Michael Fesser

        #4
        Re: OK really stupid question now.

        ..oO(Michael Vilain)
        >In article
        ><3c9d42f7-cf9a-4dd7-a420-63fb01643ba6@k1 3g2000hse.googl egroups.com>,
        Alec <ajtdds@aol.com wrote:
        >
        >Sorry guys, stupid question....
        >>
        >Am no programming expert and have only just started using php for
        >creating dynamic news pages.
        >>
        >Then I see a dynamic website without the php extension.
        >>
        >http://www.newcarnet.com/Alfa%20Romeo_news.html?id=8380
        >>
        >It has the html extension that loads the required page dynamically.
        >>
        >I thought html pages could not be dynamic. How is this done??
        >>
        >Thanks
        >>
        >Alec
        >
        >It's a very painful modification and expensive (to performance) of their
        >web server to always process html files as dynamic pages.
        That's a wrong assumption, since you don't know anything about their
        server. If for example PHP is used on every page (which it usually is
        on every bigger site), then there's nothing wrong with this approach.
        Additionally you don't know how the server maps the URLs to the actual
        files or scripts. The .html could be there just for cosmetic reasons,
        while still allowing for /foo.html being served directly and /bar.html
        processed by PHP. Quite easy to do on Apache servers.
        >Instead of
        >interpeting the pages as plain old "ship it to the remote browser and
        >don't do anything else" HTML code they modified their web server to
        >always invoke the php or perl parser.
        Could be, but you would have to ask them if that's indeed the case. You
        can't tell that from just looking at the URLs.
        >It can be done, but it's a Massively Bad Idea(tm) to bork on your web
        >server that way.
        As said - it depends.
        >If they have the processing capacity, great. But I'll
        >bet if they handle high-volume throughput, they'll soon discover that
        >stupid is a stupid does.
        I doubt that.

        Micha

        Comment

        • Michael Fesser

          #5
          Re: OK really stupid question now.

          ..oO(Alec)
          >Am no programming expert and have only just started using php for
          >creating dynamic news pages.
          >
          >Then I see a dynamic website without the php extension.
          >
          >http://www.newcarnet.com/Alfa%20Romeo_news.html?id=8380
          >
          >It has the html extension that loads the required page dynamically.
          >
          >I thought html pages could not be dynamic. How is this done??
          A URL and a file on disk are two completely different things. In fact a
          URL is just a string, things like 'directory' or 'file extension' don't
          have any meaning there. The .html above is just a 5-char string without
          any meaning.

          It depends on the server how to map those URLs onto the files or scripts
          on the disk. Usually this mapping is done directly from the URL to the
          file system, but there are also various ways for URL rewriting. There
          doesn't even have to be a file called "Alfa Romeo_news.html ", it could
          all be just a single script for example. From just looking at a URL you
          can't tell anything about what's going on behind the scenes or how the
          pages are created. It can even happen all at the same time, e.g.

          http://example.com/foo.html -static page
          http://example.com/bar.html -PHP script
          http://example.com/abc.html -SSI page
          http://example.com/xyz.html -a JPEG image

          Micha

          Comment

          • Jerry Stuckle

            #6
            Re: OK really stupid question now.

            Alec wrote:
            Sorry guys, stupid question....
            >
            Am no programming expert and have only just started using php for
            creating dynamic news pages.
            >
            Then I see a dynamic website without the php extension.
            >
            Daily car news, reviews, videos, photo galleries, road tests, blogs, motor shows, used car buying guides, advice and features from the independent UK car guide.

            >
            It has the html extension that loads the required page dynamically.
            >
            I thought html pages could not be dynamic. How is this done??
            >
            Thanks
            >
            Alec
            >
            A simple remapping in .htaccess will do it. Or there could be an SSI
            include in the .html file for the .php file. Or other ways.

            --
            =============== ===
            Remove the "x" from my email address
            Jerry Stuckle
            JDS Computer Training Corp.
            jstucklex@attgl obal.net
            =============== ===

            Comment

            • FutureShock

              #7
              Re: OK really stupid question now.

              Jerry Stuckle wrote:
              Alec wrote:
              >Sorry guys, stupid question....
              >>
              >Am no programming expert and have only just started using php for
              >creating dynamic news pages.
              >>
              >Then I see a dynamic website without the php extension.
              >>
              >http://www.newcarnet.com/Alfa%20Romeo_news.html?id=8380
              >>
              >It has the html extension that loads the required page dynamically.
              >>
              >I thought html pages could not be dynamic. How is this done??
              >>
              >Thanks
              >>
              >Alec
              >>
              >
              A simple remapping in .htaccess will do it. Or there could be an SSI
              include in the .html file for the .php file. Or other ways.
              >
              As Jerry said you can tell the server to process a page with the PHP
              Engine using any extension you want.

              for example in your .htaccess file: (apache)
              AddType application/x-httpd-php .htm .html

              will process .htm, html to the PHP engine.

              AddType application/x-httpd-php .foo

              will allow pages with .foo extensions the same.

              One thought for this is to hide the php extension to throw off some
              hackers, not sure how effective it is, but I suppose every little bit
              helps, especially if they are scanning for php extension automatically.

              Comment

              • Jerry Stuckle

                #8
                Re: OK really stupid question now.

                FutureShock wrote:
                Jerry Stuckle wrote:
                >Alec wrote:
                >>Sorry guys, stupid question....
                >>>
                >>Am no programming expert and have only just started using php for
                >>creating dynamic news pages.
                >>>
                >>Then I see a dynamic website without the php extension.
                >>>
                >>http://www.newcarnet.com/Alfa%20Romeo_news.html?id=8380
                >>>
                >>It has the html extension that loads the required page dynamically.
                >>>
                >>I thought html pages could not be dynamic. How is this done??
                >>>
                >>Thanks
                >>>
                >>Alec
                >>>
                >>
                >A simple remapping in .htaccess will do it. Or there could be an SSI
                >include in the .html file for the .php file. Or other ways.
                >>
                As Jerry said you can tell the server to process a page with the PHP
                Engine using any extension you want.
                >
                for example in your .htaccess file: (apache)
                AddType application/x-httpd-php .htm .html
                >
                will process .htm, html to the PHP engine.
                >
                AddType application/x-httpd-php .foo
                >
                will allow pages with .foo extensions the same.
                >
                One thought for this is to hide the php extension to throw off some
                hackers, not sure how effective it is, but I suppose every little bit
                helps, especially if they are scanning for php extension automatically.
                >
                Even easier - just rewrite all applicable .html extensions to .php ones.
                No need to parse .html files for php code that way.

                --
                =============== ===
                Remove the "x" from my email address
                Jerry Stuckle
                JDS Computer Training Corp.
                jstucklex@attgl obal.net
                =============== ===

                Comment

                • Jerry Stuckle

                  #9
                  Re: OK really stupid question now.

                  FutureShock wrote:
                  Jerry Stuckle wrote:
                  >Alec wrote:
                  >>Sorry guys, stupid question....
                  >>>
                  >>Am no programming expert and have only just started using php for
                  >>creating dynamic news pages.
                  >>>
                  >>Then I see a dynamic website without the php extension.
                  >>>
                  >>http://www.newcarnet.com/Alfa%20Romeo_news.html?id=8380
                  >>>
                  >>It has the html extension that loads the required page dynamically.
                  >>>
                  >>I thought html pages could not be dynamic. How is this done??
                  >>>
                  >>Thanks
                  >>>
                  >>Alec
                  >>>
                  >>
                  >A simple remapping in .htaccess will do it. Or there could be an SSI
                  >include in the .html file for the .php file. Or other ways.
                  >>
                  As Jerry said you can tell the server to process a page with the PHP
                  Engine using any extension you want.
                  >
                  for example in your .htaccess file: (apache)
                  AddType application/x-httpd-php .htm .html
                  >
                  will process .htm, html to the PHP engine.
                  >
                  AddType application/x-httpd-php .foo
                  >
                  will allow pages with .foo extensions the same.
                  >
                  One thought for this is to hide the php extension to throw off some
                  hackers, not sure how effective it is, but I suppose every little bit
                  helps, especially if they are scanning for php extension automatically.
                  >
                  It won't help. You also need to disable the advertising of php in the
                  php.ini file, for instance. But most servers have php installed anyway,
                  so hackers will check for it.

                  But if you follow good security practices in your code and server
                  configuration, it shouldn't be a problem.

                  --
                  =============== ===
                  Remove the "x" from my email address
                  Jerry Stuckle
                  JDS Computer Training Corp.
                  jstucklex@attgl obal.net
                  =============== ===

                  Comment

                  • FutureShock

                    #10
                    Re: OK really stupid question now.

                    Jerry Stuckle wrote:
                    FutureShock wrote:
                    >Jerry Stuckle wrote:
                    >>Alec wrote:
                    >>>Sorry guys, stupid question....
                    >>>>
                    >>>Am no programming expert and have only just started using php for
                    >>>creating dynamic news pages.
                    >>>>
                    >>>Then I see a dynamic website without the php extension.
                    >>>>
                    >>>http://www.newcarnet.com/Alfa%20Romeo_news.html?id=8380
                    >>>>
                    >>>It has the html extension that loads the required page dynamically.
                    >>>>
                    >>>I thought html pages could not be dynamic. How is this done??
                    >>>>
                    >>>Thanks
                    >>>>
                    >>>Alec
                    >>>>
                    >>>
                    >>A simple remapping in .htaccess will do it. Or there could be an SSI
                    >>include in the .html file for the .php file. Or other ways.
                    >>>
                    >As Jerry said you can tell the server to process a page with the PHP
                    >Engine using any extension you want.
                    >>
                    >for example in your .htaccess file: (apache)
                    >AddType application/x-httpd-php .htm .html
                    >>
                    >will process .htm, html to the PHP engine.
                    >>
                    >AddType application/x-httpd-php .foo
                    >>
                    >will allow pages with .foo extensions the same.
                    >>
                    >One thought for this is to hide the php extension to throw off some
                    >hackers, not sure how effective it is, but I suppose every little bit
                    >helps, especially if they are scanning for php extension automatically.
                    >>
                    >
                    It won't help. You also need to disable the advertising of php in the
                    php.ini file, for instance. But most servers have php installed anyway,
                    so hackers will check for it.
                    >
                    But if you follow good security practices in your code and server
                    configuration, it shouldn't be a problem.
                    >
                    That is why stated as to how effective it was. I am not questioning the
                    validity of it, just how simple it would be if you so choose to alter
                    the extension. The statement about why it would be done, I had read off
                    a site. Probably a well know site.

                    I personally use the php extension.

                    Scotty

                    Comment

                    Working...