Is HTML/PHP an Either/Or thing?

Discussion in 'HTML & Website Design' started by NeedyNotShy, Jul 3, 2010.

  1. #1
    I've seen where some PHP features require an php extension. Or do they all? Can I code an HTML page and still use PHP? Should I just do it all with PHP? Please comment extensively on the various ins & outs of these questions.

    Mucho Appreciado!!
    Needy
     
    NeedyNotShy, Jul 3, 2010 IP
  2. Mystique

    Mystique Well-Known Member

    Messages:
    2,579
    Likes Received:
    94
    Best Answers:
    2
    Trophy Points:
    195
    #2
    Static pages are fine with html but if you want to develop dynamic content then go for PHP. Extension? that is not up to you but a server/hosting service matter and most providers offers you common extensions already installed to play with, unless you need something very special in which case you may try getting a dedicated server.
     
    Mystique, Jul 3, 2010 IP
  3. Rainulf

    Rainulf Active Member

    Messages:
    373
    Likes Received:
    12
    Best Answers:
    0
    Trophy Points:
    85
    #3
    I'm not sure what you meant by php extension, so I'm assuming you mean files with .php. As far as I know, most servers will recognize any file with .php extension as PHP. As Mystique said, it depends on the type of your website. If your website has dynamic contents, then php is a must. If static contents, then html will do.

    Yeah, just do it all php if I were you. It's more exciting that way!
     
    Rainulf, Jul 3, 2010 IP
  4. NeedyNotShy

    NeedyNotShy Peon

    Messages:
    7
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    TY Mystique & Rainulf I shoud be more specific. I tried to use an SSI in my HTML page: <!--#include file="topmsg.html" --> but it did not work on my dev server or my host. PHP includes seem to work with no trouble on both. I installed the EasyPHP package on my home PC for the dev server. Maybe the defaults do not provide ASP and that's what I need to do SSI with HTML. Most pages I see out there are html and seem to be very dynamic. Maybe they use ASP? (Which I have not delved into.) The default I see most everywhere is index.html so I am hesitant about using .php where the general public may not get it. Maybe I can tell my servers to default to php? I like php! I may be off base thinking ASP is my problem w/SSI&HTML. I'm learning fast but have a way to go! This forum helps a ton!

    Thanks to All.
    Needy
     
    NeedyNotShy, Jul 3, 2010 IP
  5. Rainulf

    Rainulf Active Member

    Messages:
    373
    Likes Received:
    12
    Best Answers:
    0
    Trophy Points:
    85
    #5
    PHP is pretty famous and widely known, so you'll get more support with php. Plus, it's fun. I've never used SSI before, but from the looks of it, it works like php's include. Maybe the reason why you see .htmls out there is because those websites use .htaccess rewrite to change the naming of their files for it to be search engine friendly, with .htaccess rewrite, you can change your boring php file name from:
    http://yoursite.com/index.php?open=234
    Code (markup):
    To these:
    http://yoursite.com/open-234
    http://yoursite.com/234
    http://yoursite.com/234.html
    Code (markup):
    You should look it up! :)
     
    Rainulf, Jul 3, 2010 IP
  6. NeedyNotShy

    NeedyNotShy Peon

    Messages:
    7
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Thank you Rainulf! That nailed it. You've been promoted! That looks a lot like shell programming. Jeeze, where did I put that book 20 years ago! I'm off to PHP Land. (And CSS(and MySQL(and JS(and Ad Nauseum...))))

    Needy
     
    NeedyNotShy, Jul 5, 2010 IP