Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    Regular Coder
    Join Date
    Jul 2005
    Posts
    352
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Include .php file in a .htm file

    Hi all,
    Just started and i want to know if it is possible to include a php file in a .htm file and how would i do this?

    Thanks in Advance,
    Any help would be appreciated,

    MW2005

  • #2
    New Coder
    Join Date
    Nov 2005
    Location
    Louisville, Kentucky
    Posts
    94
    Thanks
    0
    Thanked 0 Times in 0 Posts
    i dont think its possible to include a .PHP file in a .HTML file, although it is possible to do it the other way around using the
    PHP Code:
    include(...path to .HTML file...); 
    function.
    What was I thinking?
    Email Me

  • #3
    Regular Coder
    Join Date
    Jul 2005
    Posts
    352
    Thanks
    1
    Thanked 0 Times in 0 Posts
    I Have this and i cannot seem to make it work

    index.htm
    Code:
    <html>
    <head></head>
    <body>
    TEXT
    <?php include("http://localhost/log.php")?>
    </body>
    </html>

  • #4
    New Coder
    Join Date
    Nov 2005
    Location
    Louisville, Kentucky
    Posts
    94
    Thanks
    0
    Thanked 0 Times in 0 Posts
    You are using a .html file for a .php file, unless you have set ur Apache server to parse .html files as .php files, it is impossible to use PHP code in a .html file.
    What was I thinking?
    Email Me

  • #5
    Regular Coder
    Join Date
    Jul 2005
    Posts
    352
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Thanks for the speedy responce,
    I will do that now,

    MW2005


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •