#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2006
    Posts
    10
    Rep Power
    0

    Changing ,html pages to .php pages


    I know I can easily change a .html page to a .php page by just changing the suffix, but should I?
    What unintended consequences are there to doing this?
    I started out simply trying to have my 'nav menu' embedded in the .css file (is this the stylesheet?)
    so I could just edit the nav menu once and have the change updated on each page but I found out
    that it's not possible to embed links within the .css file.
    I know it can be done with .php but is that using a steamroller to crack a nut shell?
    Is there an better way?
    Thanks
    Chris
    p.s. I've got no idea what I'm talking about, all I do is cut and paste from one of my websites to the other!
  2. #2
  3. Forgotten Moderator
    Devshed Supreme Being (6500+ posts)

    Join Date
    Mar 2007
    Location
    Washington, USA
    Posts
    16,212
    Rep Power
    9644
    Originally Posted by windspeed
    I know I can easily change a .html page to a .php page by just changing the suffix, but should I?
    Maybe?

    Originally Posted by windspeed
    What unintended consequences are there to doing this?
    Anything that looks like PHP code will get executed. Your page load times will go up. Your server resource usage will increase.

    Originally Posted by windspeed
    I started out simply trying to have my 'nav menu' embedded in the .css file (is this the stylesheet?)
    Yes that's the stylesheet, but putting a nav menu in CSS doesn't make sense because CSS does not add content to a page.

    Originally Posted by windspeed
    so I could just edit the nav menu once and have the change updated on each page but I found out
    that it's not possible to embed links within the .css file.
    Again, because CSS does not add content to a page.

    Originally Posted by windspeed
    I know it can be done with .php but is that using a steamroller to crack a nut shell?
    PHP is a fully-stocked kitchen, not a steamroller. And all you need is a nutcracker. So that's okay.

    Originally Posted by windspeed
    Is there an better way?
    There is one way that's probably not available to you because it's an old way of doing things, so go with PHP.
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2016
    Posts
    84
    Rep Power
    4
    If YOU currently spend a lot of time manually creating separate html pages, that mainly differ in the content on them, and the corresponding navigation, then spend more time to fix typos, links, and make all the pages look the same, then yes, you need to switch to a server-side scripting language and a content management system (CMS) to get the computer to do the this repetitive and error prone work for you.

    If you make this switch, you would use a template to define the overall look of the site. Server-side script would dynamically produce the navigation and populate the template with the requested content for any page. The content that's different between the pages would be stored in a database.

    By using a template, all pages on a site will look the same and you would only change a template if you want to change or fix how the site looks.

    Once this has been set up, you would only need to manage the content that's been stored in the database. The server-side scripting would take care of dynamically serving up the different web pages on a site.
  6. #4
  7. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2006
    Posts
    10
    Rep Power
    0
    Originally Posted by requinix
    Maybe?


    Anything that looks like PHP code will get executed. Your page load times will go up. Your server resource usage will increase.


    Yes that's the stylesheet, but putting a nav menu in CSS doesn't make sense because CSS does not add content to a page.


    Again, because CSS does not add content to a page.


    PHP is a fully-stocked kitchen, not a steamroller. And all you need is a nutcracker. So that's okay.


    There is one way that's probably not available to you because it's an old way of doing things, so go with PHP.
    Hi, thanks for the multiple answers, I'll work my way through PHP. As my mum used to say, 'do it properly, do it once!"
    Cheers Chris
  8. #5
  9. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2006
    Posts
    10
    Rep Power
    0
    CMS eh?, I'll do some homework on that start the process. Thanks Chris

IMN logo majestic logo threadwatch logo seochat tools logo