1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

PHP or SHTML: What's better?

Discussion in 'PHP' started by richieg100, Aug 24, 2005.

  1. #1
    Hey guys,
    I'm hosting on a linux so my only option for Server Scripting is a combination of PHP + MySQL. However, I'm not quite sure if it would be better to give all my pages a .shtml or a .php extension.

    If you guys could tell me which one is better and why I'd be really thankful. Also, would you know which one would be the easiest to update/upgrade in the future?
     
    richieg100, Aug 24, 2005 IP
  2. exam

    exam Peon

    Messages:
    2,434
    Likes Received:
    120
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Name them whatever you want and tell the server to parse it with the php engine. That said, you should probably use .php
     
    exam, Aug 24, 2005 IP
  3. Willy

    Willy Peon

    Messages:
    281
    Likes Received:
    25
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Welcome to DP, Richie :)

    As exam said, name them anything you want. For PHP scripts ".php" is the normal extension. However, if you want them to look like static pages, name them ".html" and make Apache parse that extension as PHP.
     
    Willy, Aug 24, 2005 IP
  4. richieg100

    richieg100 Peon

    Messages:
    17
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Well, my pages display primarily static content, however i think .php would be better to use as the site gets more advanced so i guess I'll go with that.

    But should I use .php or .php3? and whats with .php4?
     
    richieg100, Aug 24, 2005 IP
  5. exam

    exam Peon

    Messages:
    2,434
    Likes Received:
    120
    Best Answers:
    0
    Trophy Points:
    0
    #5
    using .php3 etc. is depricated, use .php
     
    exam, Aug 24, 2005 IP
  6. richieg100

    richieg100 Peon

    Messages:
    17
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #6
    ok, just one last question: are there any other extensions that allow PHP+MySQL besides .php and .shtml?
    thanks
     
    richieg100, Aug 24, 2005 IP
  7. Willy

    Willy Peon

    Messages:
    281
    Likes Received:
    25
    Best Answers:
    0
    Trophy Points:
    0
    #7
    As said, it can be any extension. It all depends on your web server (Apache) configuration.
     
    Willy, Aug 24, 2005 IP
  8. mark_79_smith

    mark_79_smith Peon

    Messages:
    3
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #8
    Seeing as no-one else would help this poor chap out..

    If you don't have a .htaccess file already in the root of your web directory create one and add the following line.

    AddType application/x-httpd-php .php .html .htm

    You will then be able to use php tags in any file with the extensions .html and .htm.
     
    mark_79_smith, Aug 25, 2005 IP
  9. T0PS3O

    T0PS3O Feel Good PLC

    Messages:
    13,219
    Likes Received:
    777
    Best Answers:
    0
    Trophy Points:
    0
    #9
    Some people of lyrics sites name their files like: u2.music, then as mark 79 suggests just tell the server to parse them through php.
     
    T0PS3O, Aug 25, 2005 IP
    dct likes this.
  10. richieg100

    richieg100 Peon

    Messages:
    17
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #10
    thanks mark! I'm gonna do that. I think ill use the .ssp extension. lol if someone reads this and thinks it would be better if i used another etension please tell me.

    By the way: i altered the .htaccess and it worked!
     
    richieg100, Aug 25, 2005 IP
  11. programmer

    programmer Guest

    Messages:
    444
    Likes Received:
    20
    Best Answers:
    0
    Trophy Points:
    0
    #11
    you can use what ever u like

    .php, .phtml, .phtml, .inc, .tpl etc..... even .programmer:D

    but normally people use .php for php pages coz its easy to remmember for visitors.
     
    programmer, Aug 27, 2005 IP
  12. richieg100

    richieg100 Peon

    Messages:
    17
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #12
    thanks alot
     
    richieg100, Aug 27, 2005 IP