Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    Senior Coder
    Join Date
    Jul 2005
    Location
    UK
    Posts
    1,051
    Thanks
    6
    Thanked 13 Times in 13 Posts

    Parsing PHP in HTML

    There's tonnes of information available on this subject and every single page I go to I've been told to place the following in .htaccess:

    Code:
    AddType application/x-httpd-php .php .html .htm
    The problem is, for me that doesn't seem to enable PHP parsing, it causes the browser (both Firefox and IE) to force a download prompt! Could this be something to do with my server? If so, are there any alternative methods?

  • #2
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    Hmm I tried adding that to my .htaccess file and I get a 500 error on my apache server. I guess it has to do with your server settings. How many pages do you have that you want to make dynamic?
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #3
    Senior Coder NancyJ's Avatar
    Join Date
    Feb 2005
    Location
    Bradford, UK
    Posts
    3,174
    Thanks
    19
    Thanked 66 Times in 65 Posts
    would it not be simpler to just save them as php files?
    If your hosts offer cpanel you can set your server to parse html pages as php through a nice gui interface

  • #4
    Senior Coder
    Join Date
    Jul 2005
    Location
    UK
    Posts
    1,051
    Thanks
    6
    Thanked 13 Times in 13 Posts
    It would indeed be simpler, but my client has dictated that they want the site to remain as .html, but they'd also happen to like some of the functionality of PHP - so, it will be the whole site of around 30 pages.

    Oh well, guess they're going to have to choose

  • #5
    Senior Coder NancyJ's Avatar
    Join Date
    Feb 2005
    Location
    Bradford, UK
    Posts
    3,174
    Thanks
    19
    Thanked 66 Times in 65 Posts
    First thing I would do is find out why they want to keep the site as .html - then explain why they're being completely stupid and clueless
    If they still insist on keeping the .html extention after you've explained that the file extention makes no difference etc then you could try doing a mod rewrite to rewrite the .html uris to direct to .php pages


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •