Perl site, html templates, How to get, php include statement

Discussion in 'PHP' started by Marty_, Jan 22, 2008.

  1. #1
    I run a Perl website and I am trying to get on my home page one piece of php code, the usual php include, can anyone tell me how to do that please

    My home page URL uses SSI index.shtml which loads <!--#exec cgi="/dir.cgi"-->

    My home page template is located at /data/templates/Default/FrontPage.html

    My domain if it helps www.web-bin.com
     
    Marty_, Jan 22, 2008 IP
  2. nico_swd

    nico_swd Prominent Member

    Messages:
    4,153
    Likes Received:
    344
    Best Answers:
    18
    Trophy Points:
    375
    #2
    PHP isn't parsed in shtml files by default. And if you just need includes, you can use SSI.
     
    nico_swd, Jan 22, 2008 IP
  3. Marty_

    Marty_ Banned

    Messages:
    1,031
    Likes Received:
    44
    Best Answers:
    0
    Trophy Points:
    0
    #3
    I know that I was mearly pointing out the home page dir.cgi file.
    I can use SSI to call a php file, you sure ?
     
    Marty_, Jan 22, 2008 IP
  4. nico_swd

    nico_swd Prominent Member

    Messages:
    4,153
    Likes Received:
    344
    Best Answers:
    18
    Trophy Points:
    375
    #4
    I don't think so. You said:

    I guess that confused me. I thought you wanted to include this page.


    You can set an htaccess file, to make PHP parse shtml files too. That's probably the easiest way.
    
    AddType application/x-httpd-php .shtml
    
    Code (markup):
     
    nico_swd, Jan 22, 2008 IP
  5. Marty_

    Marty_ Banned

    Messages:
    1,031
    Likes Received:
    44
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Ok my bad, maybe, the dir.cgi is my start page to load the home page template above.

    If you look at my template FrontPage.html

    I want to drop the [[featured_home_title]] and replace that with for example

    <?php
    include './somefile.php';
    ?>

    I have been trying everything I know which isn't much so I thought I would ask here.
     
    Marty_, Jan 22, 2008 IP
  6. Marty_

    Marty_ Banned

    Messages:
    1,031
    Likes Received:
    44
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Anybody else have any suggestions ?
     
    Marty_, Jan 23, 2008 IP