dynamicaly creating .htm pages with php

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • tolkienarda
    Contributor
    • Dec 2006
    • 316

    #1

    dynamicaly creating .htm pages with php

    hi all
    i want to be able to create a .htm file using php. i don't know if this is even possible. am wanting to create a site that has the functionality of php but the google searchability of a static .htm site.
    so i will need to create .htm's and populate them with code now if this isn't possible in php then is there a language i can do it in

    thanks all

    eric
  • michaelb
    Recognized Expert Contributor
    • Nov 2006
    • 534

    #2
    PHP is a server-side language, and it is perfectly suited for writing dynamic web pages.

    This is a very simple example of such page, where some contents (date/time) is dynamically generated every time your browser requests the page.

    Code:
    <head>
      <title>Hello!</title>
    </head>
    <body>
    
    <?php
       echo date('r');
    ?>
    
    </body>
    </html>
    In real life much of dynamically generated contents comes from the database.

    Comment

    • tolkienarda
      Contributor
      • Dec 2006
      • 316

      #3
      hi
      i don't think i was clear in my question. i am creating a page for a realastate company that they add listings to in a form and i have a php page that will display the correct listing based on the link they click on. but google cannot search within the contents of a database so what i would like to be able to do is create .htm file every time a listing is added that will contain all of the the text that is displayed in the .php page for the sole pourpose of google searchability. so somthing like the imagecreatetrue color() function and only rather than creating an image file i would like to create a .htm file then write to it using somthing like the fwrite() function.
      if my question still isn't clear please ask any questions about it

      eric

      Comment

      • michaelb
        Recognized Expert Contributor
        • Nov 2006
        • 534

        #4
        Thank you for clarification.
        I have to say that I have only a cursory knowledge in this area, perhaps someone else will take a lead here.

        But if I could say what I think, you may be heading in a wrong direction.
        It may take weeks (or months) before Google updates its database with your new html contents. By that time the house can be long gone from the market.
        Also there are other reasons which make this idea less than appealing.

        And what do you expect people would enter for a search string, a specific street address of the house?
        I would guess that in most cases people run queries with something like "real estate Boston", (19600000 hits), or "House sale Munich" (1240000 hits)

        If this is the case you may only need to use the meta-tags/keywords, and if not done this already - submit your site to major search engines. Many hosting companies do it for their customers.

        Comment

        • tolkienarda
          Contributor
          • Dec 2006
          • 316

          #5
          thanks for your advice i am from backward nowhere i will present these arguments and ideas to my boss but i think she will still want the .htm pages.
          thanks again

          eric

          Comment

          • michaelb
            Recognized Expert Contributor
            • Nov 2006
            • 534

            #6
            Eric, you are welcome.
            If you still have to do it I don't think there will be any real problems code wise, PHP should give you all necessary means and ways.

            Perhaps you could run a little experiment first - create a new static html page and see how long it'll take before Google has it indexed.

            There are many sources on the net that can give you a good overview of how search engines work, here's just one of them:

            Comment

            Working...