Web Analytics Made Easy -
StatCounter Running PHP from .htm files - CodingForum

Announcement

Collapse
No announcement yet.

Running PHP from .htm files

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Running PHP from .htm files

    Right, Ive just finished my latest website and all the files are in *.htm format.

    Id forgot about the tracking etc - doh!

    so do i need to rename all pages to php and change all my links or is there a way i can include the php pages in the html ones without having to rename any files?

    Thanks
    Fatman
    Andrew Hall

  • #2
    You need to tell your server what to do with .htm files. If he doesn't send them for preprocessing to the PHP engine, no PHP code will be executed within. Should you be on an Apacher server and have the rights to use .htaccess files, you can put this line into a .htaccess file to let .htm files be parsed by PHP.

    Code:
    AddType application/x-httpd-php .htm
    De gustibus non est disputandum.

    Comment


    • #3
      thanks very much - that worked a treat!
      Andrew Hall

      Comment

      Working...
      X