Announcement

Collapse
No announcement yet.

Parsing PHP in SHTML files

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

  • Parsing PHP in SHTML files

    Hi all

    Much of my website uses the .shtml extension (it includes server side includes for menus etc)

    The website is well established with search engines so I don't want to change any extensions.

    However the time has come to add some bits of php code into the .shtml pages. So I need to get them to parse <?php code as well as <!--#include...

    I thought I could just add
    AddType application/x-httpd-php .shtml
    to my .htaccess file but this doesn't seem to make it parse php in .shtml files.

    Can anyone help me to get this to work without it breaking the <!--#include.. statements?
    Last edited by paulwebster; 04-11-2008, 11:01.

  • #2
    Hello,

    It may of something to do with the php install file i will get a tech. to look at it thanks.

    Regards

    Robert

    Comment


    • #3
      Thanks for your reply.

      Don't worry about it - I've come up with another solution - SSI including some php files

      Comment


      • #4
        Suppose thats one way of doing it. Maybe in the next redesign of your site you should look to streamline the process? .
        David Smith
        Managing Director
        DPS Computing Limited

        - Massive update! (September 2011) - It's now not neglected!!
        - New Site (10/2009)

        Comment


        • #5
          Thanks for the tip. As far as I was aware, SSI's are pretty efficient with resources, so maybe this isn't such a bad way of pulling in some PHP into the pages? I'm only passing a single variable from the page to the php file, and it does mean that the vast bulk of the pages don't have to go through the php processor.

          Do you think this is inefficient? I'm not an expert so any ideas welcome.

          Comment


          • #6
            No, it does sound like quite a reasonable way of doing it .
            David Smith
            Managing Director
            DPS Computing Limited

            - Massive update! (September 2011) - It's now not neglected!!
            - New Site (10/2009)

            Comment

            Working...
            X