Using PHP in SHTML pages? Is it possible?

Discussion in 'Site & Server Administration' started by Dio, Mar 15, 2006.

  1. #1
    I want to try running Text-Ad-Links on my site at http://thenextbigwebthing.com - I didn't realise that the pages needed to be PHP when I made the site so now everything is SHTML (as it uses includes) - Is there any way to make .shtml pages use PHP code on the page without renaming the extensions? Its a Linux server the site's running on. Any advice appreciated. :)
     
    Dio, Mar 15, 2006 IP
  2. mad4

    mad4 Peon

    Messages:
    6,986
    Likes Received:
    493
    Best Answers:
    0
    Trophy Points:
    0
    #2
    If you can use includes then just include a php file with your code in it.
     
    mad4, Mar 15, 2006 IP
    Dio likes this.
  3. Dekker

    Dekker Peon

    Messages:
    4,185
    Likes Received:
    287
    Best Answers:
    0
    Trophy Points:
    0
    #3
    what the heck is SHTML?
     
    Dekker, Mar 15, 2006 IP
  4. Dio

    Dio Well-Known Member

    Messages:
    725
    Likes Received:
    55
    Best Answers:
    0
    Trophy Points:
    120
    #4
    SHTML is HTML with added server side includes. So yo can just have one include file to edit on your page and it changes sitewide. Nice and easy. :) SSIs only work when the page is .shtml normally.
     
    Dio, Mar 15, 2006 IP
  5. Dio

    Dio Well-Known Member

    Messages:
    725
    Likes Received:
    55
    Best Answers:
    0
    Trophy Points:
    120
    #5
    Ok, I got it, the way to do it is to create an include called /path/ads.php, and put the php code in there. Then, all you need to do on the SHTML page is include it like so: <!--#include virtual="/path/ads.php" --> and it works fine. :)
     
    Dio, Mar 15, 2006 IP