is there a way to use include on .html files?

Discussion in 'PHP' started by OaldDesign, Jan 23, 2010.

  1. #1
    hey wanted to know if there is a way to use include function on .html file intend of on .php file? the reason for that is that most of my site is on .html and i dont want to change it to .php because of the search engine and wanted to know if there is a way to do that.
    thanks
     
    OaldDesign, Jan 23, 2010 IP
  2. shallowink

    shallowink Well-Known Member

    Messages:
    1,218
    Likes Received:
    64
    Best Answers:
    2
    Trophy Points:
    150
    #2
    shallowink, Jan 24, 2010 IP
  3. OaldDesign

    OaldDesign Active Member

    Messages:
    448
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    60
    #3
    yes i found something like that in google in the start but didnt found the file because he is hidden in the ftp but thanks for the help i think admisn can close this trade
     
    OaldDesign, Jan 24, 2010 IP
  4. JAY6390

    JAY6390 Peon

    Messages:
    918
    Likes Received:
    31
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Yeah the htaccess method is the only way short of changing your httpd.conf file directly. You should be able to see hidden files with FTP. If you can't, contact your hosting provider and ask them to change it for you
     
    JAY6390, Jan 24, 2010 IP
  5. shallowink

    shallowink Well-Known Member

    Messages:
    1,218
    Likes Received:
    64
    Best Answers:
    2
    Trophy Points:
    150
    #5
    Actually, most FTP clients have a setting to show hidden files. In filezilla its under Server > Force Showing Hidden Files
     
    shallowink, Jan 24, 2010 IP
  6. JAY6390

    JAY6390 Peon

    Messages:
    918
    Likes Received:
    31
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Isn't that on by default in filezilla?
     
    JAY6390, Jan 24, 2010 IP
  7. shallowink

    shallowink Well-Known Member

    Messages:
    1,218
    Likes Received:
    64
    Best Answers:
    2
    Trophy Points:
    150
    #7
    No its not. It does pop up a dialog explaining most FTP servers show all files but some are broken. It shouldn't be needed. I always try to do everything possible myself before asking the hosting providers to change things since they are often slow to respond. Has been like 2 times were it actually worked.
     
    shallowink, Jan 24, 2010 IP
  8. JAY6390

    JAY6390 Peon

    Messages:
    918
    Likes Received:
    31
    Best Answers:
    0
    Trophy Points:
    0
    #8
    Ah OK. Good to know thanks :)
     
    JAY6390, Jan 24, 2010 IP
  9. astkboy2008

    astkboy2008 Peon

    Messages:
    211
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #9
    there is three ways
    1- write in html file php cods between <?php ?> then include the files by include();
    2- by .htaccess
    3-by PHP Templates Engine
     
    astkboy2008, Jan 24, 2010 IP
  10. SmallPotatoes

    SmallPotatoes Peon

    Messages:
    1,321
    Likes Received:
    41
    Best Answers:
    0
    Trophy Points:
    0
    #10
    If you are using include() you shouldn't have to make any changes to your server settings; PHP will include any file regardless of name and attempt to process it as PHP.
     
    SmallPotatoes, Jan 24, 2010 IP
  11. danx10

    danx10 Peon

    Messages:
    1,179
    Likes Received:
    44
    Best Answers:
    2
    Trophy Points:
    0
    #11
    add the following snippet in your .htaccess:

    AddType application/x-httpd-php .html
    Code (markup):
     
    danx10, Jan 25, 2010 IP