Adding a php script into a html page?

Discussion in 'Programming' started by Browning, Jan 31, 2008.

  1. #1
    I'm trying to include a php pagerank script into a html page. How is this possible?
     
    Browning, Jan 31, 2008 IP
  2. archard

    archard Peon

    Messages:
    221
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #2
    You can add this to htaccess to get html files to parse as php
    
    AddType application/x-httpd-php .html
    PHP:
     
    archard, Jan 31, 2008 IP
  3. Browning

    Browning Banned

    Messages:
    1,928
    Likes Received:
    29
    Best Answers:
    0
    Trophy Points:
    0
    #3
    so what do I put into my html page?
     
    Browning, Jan 31, 2008 IP
  4. Browning

    Browning Banned

    Messages:
    1,928
    Likes Received:
    29
    Best Answers:
    0
    Trophy Points:
    0
    #4
    is this possible?
     
    Browning, Feb 1, 2008 IP
  5. jorgy

    jorgy Peon

    Messages:
    611
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    0
    #5
    After you update the .htaccess file, you should just be able to insert PHP into the html using a <?php> beginning and <?php> end tag.
     
    jorgy, Feb 1, 2008 IP
  6. Browning

    Browning Banned

    Messages:
    1,928
    Likes Received:
    29
    Best Answers:
    0
    Trophy Points:
    0
    #6
    just put the scripts code inside those tags?
     
    Browning, Feb 1, 2008 IP
  7. infogle

    infogle Prominent Member

    Messages:
    2,732
    Likes Received:
    128
    Best Answers:
    1
    Trophy Points:
    300
    #7
    include in a iframe... or include a ajax code

    php file will run at other place and it will be embedded in html page...
     
    infogle, Feb 1, 2008 IP
  8. Browning

    Browning Banned

    Messages:
    1,928
    Likes Received:
    29
    Best Answers:
    0
    Trophy Points:
    0
    #8
    cant say I know how to do that

    www.whodatis.com this is my site

    The coming soon in the navigation I would like to make a pagerank script page
     
    Browning, Feb 1, 2008 IP
  9. jorgy

    jorgy Peon

    Messages:
    611
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    0
    #9
    Yes, if you've modified the .htaccess file, then you can just include PHP code in your .html page. There's no need for ajax. Another, more simple solution. Just change the extension of your page to .PHP. It'll function just like a .html, but it'll parse both the .php and .html
     
    jorgy, Feb 1, 2008 IP
  10. Browning

    Browning Banned

    Messages:
    1,928
    Likes Received:
    29
    Best Answers:
    0
    Trophy Points:
    0
    #10
    my template currenlt is header.html and footer.html

    Could I just make a php file that calls both, and add the script in it? If so, how do I call the header and footer
     
    Browning, Feb 1, 2008 IP
  11. Ross1234

    Ross1234 Peon

    Messages:
    78
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #11
    <?php include"header.html";?>
    <?php include"footer.html";?>
    PHP:
     
    Ross1234, Feb 1, 2008 IP
  12. Browning

    Browning Banned

    Messages:
    1,928
    Likes Received:
    29
    Best Answers:
    0
    Trophy Points:
    0
    #12
    Ok so I decided to just include my template via calling the header and footer

    It worked great but the pr checker isnt working

    http://whodatis.com/pr/
     
    Browning, Feb 1, 2008 IP
  13. Browning

    Browning Banned

    Messages:
    1,928
    Likes Received:
    29
    Best Answers:
    0
    Trophy Points:
    0
    #13
    got it to work now. But I have two head tags and two doc types(look at page source)

    Which do I keep? The one from the header.html or the one from the pagerank script

    edit-just noticed it throws my page left. I'm lost
     
    Browning, Feb 1, 2008 IP