4 Replies Latest reply on Feb 12, 2010 3:29 PM by Nancy OShea

    Combining PHP Pages With HTML Pages.

    Guild1812

      Hi,

       

      I started building my site in Dreamweaver CS4 using HTML pages, not knowing until now that any pages with interactivity need to be php.

       

      If my site has seven pages, can four of them be HTML, and the rest PHP? If so, are there any special considerations I have to take into account? Is there anything special that would have to be done at any time during the process of creating the PHP pages, uploading to a web host, etc?

       

      If not, is there a way to convert the HTML pages directly to PHP, or do I have to basically start from scratch?

       

      Thank you.

        • 1. Re: Combining PHP Pages With HTML Pages.
          John Waller Adobe Community Professional & MVP

          There's no technical reason that you cannot have a mix of .htm and .php pages but I'd advise against it to keep everything consistent and simple.

           

          If you ever need to add PHP script to the .htm pages later then you'll have to rename them again. Convert them all to .php now.

           

          Using Dreamweaver's File Panel, just rename the .htm pages with a .php extension and Dreamweaver will automatically update all the links for you.

           

          Delete the .htm pages from your server and upload all the .php ones.

           

          The only downside is if anyone has bookmarked the .htm pages then they'll get a 404 File Not Found error. However, given that your website is in its infancy, that may not be an issue at this stage.

          • 2. Re: Combining PHP Pages With HTML Pages.
            Nancy OShea Adobe Community Professional & MVP

            Better to be consistent.  You CAN have php,  htm, html and shtml pages in your site, but this could cause a server conflict if you accidentally upload more than one index page to the same folder.

             

            Simply rename your ***.htm pages to ***.php (F2).

             

            Remove ***.htm pages from testing and remote servers.

             

             

            Nancy O.
            Alt-Web Design & Publishing
            Web | Graphics | Print | Media  Specialists
            www.alt-web.com/
            www.twitter.com/altweb
            www.alt-web.blogspot.com

            • 3. Re: Combining PHP Pages With HTML Pages.
              Guild1812 Level 1

              Changing the extensions is certainly easy enough.

               

              I don't have to make any changes to the code of the already constructed HTML pages?

              • 4. Re: Combining PHP Pages With HTML Pages.
                David_Powers Adobe Community Professional

                Guild1812 wrote:

                 

                Changing the extensions is certainly easy enough.

                 

                I don't have to make any changes to the code of the already constructed HTML pages?

                No. Adding a .php extension simply processes any PHP code. If there isn't any, it makes no difference. What it does mean, though, is that you can add PHP code at any time in the future, and it will work.