How to use a PHP include?

Discussion in 'PHP' started by pr0xy122, Aug 24, 2007.

  1. #1
    Ok I have been trying to do this for about 1:30 minutes now, so I am going to ask here.

    I have a HTML file and in the side bar I make the include call:
     <?php include("dd.php"); ?>
    Code (markup):
    On dd.php I have on link:
    <a href="#">Portfolio</a>
    Code (markup):
    But when I test it out on a PHP compatible server etc it does not show up on the HTML file.

    Here is the html file http://pimpleblog.com/acnetret/template.html (dd.php and the css file is accessible from this URL).

    Thanks :).
     
    pr0xy122, Aug 24, 2007 IP
  2. keela

    keela Peon

    Messages:
    124
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    It should be called template.php to work (link)
     
    keela, Aug 24, 2007 IP
  3. THT

    THT Peon

    Messages:
    686
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    0
    #3
    your html files are set to not run Php

    Rename your index page to *.php to prove this...
     
    THT, Aug 24, 2007 IP
  4. pr0xy122

    pr0xy122 Peon

    Messages:
    1,649
    Likes Received:
    21
    Best Answers:
    0
    Trophy Points:
    0
    #4
    I thought it was possible to embed php into HTML? - because to have that page as a .html is almsot a must for me (seo reasons).

    Ty.
     
    pr0xy122, Aug 24, 2007 IP
  5. just-4-teens

    just-4-teens Peon

    Messages:
    3,967
    Likes Received:
    168
    Best Answers:
    0
    Trophy Points:
    0
    #5
    http://www.eukhost.com/support/knowledgebase/using-php-tag-in-html-pages/
     
    just-4-teens, Aug 24, 2007 IP
  6. pr0xy122

    pr0xy122 Peon

    Messages:
    1,649
    Likes Received:
    21
    Best Answers:
    0
    Trophy Points:
    0
    #6
    how do I access AddHandler ?
     
    pr0xy122, Aug 24, 2007 IP
  7. DKameleon

    DKameleon Member

    Messages:
    29
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    38
    #7
    You can try to add following line to your .htaccess (create it if it is not exists):
    AddType application/x-httpd-php .html
    Code (markup):
    .htaccess - must be located in a directory with *.html you need to be processed, or even better in the website root.
     
    DKameleon, Aug 24, 2007 IP
  8. pr0xy122

    pr0xy122 Peon

    Messages:
    1,649
    Likes Received:
    21
    Best Answers:
    0
    Trophy Points:
    0
    #8
    dont worry I found a place in cpanel where I could add it, I did and it works great.

    Thanks for leading me there guys.
     
    pr0xy122, Aug 24, 2007 IP
  9. just-4-teens

    just-4-teens Peon

    Messages:
    3,967
    Likes Received:
    168
    Best Answers:
    0
    Trophy Points:
    0
    #9
    no problem (i learnt something new while trying to help you :) )
     
    just-4-teens, Aug 24, 2007 IP
  10. ritadebock

    ritadebock Peon

    Messages:
    344
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #10
    AddType application/x-httpd-php .html
     
    ritadebock, Aug 26, 2007 IP
  11. jorgy

    jorgy Peon

    Messages:
    611
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    0
    #11
    jorgy, Aug 26, 2007 IP