Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

server side php include in html

Options
  • 18-02-2002 6:30pm
    #1
    Registered Users Posts: 10,501 ✭✭✭✭


    Is it possible to include a php file in html

    I think i remember the include for cgi is something like

    <include src="blah.cgi">

    is there any command like that for including php on a normal html page?


Comments

  • Banned (with Prison Access) Posts: 16,659 ✭✭✭✭dahamsta


    If Includes are enabled, you can use the Include virtual directive. See here.

    adam


  • Closed Accounts Posts: 19,777 ✭✭✭✭The Corinthian


    Originally posted by Slydice
    Is it possible to include a php file in html
    Is there any reason why you can't just include it in just another PHP file using require/include?


  • Registered Users Posts: 7,739 ✭✭✭mneylon


    If you have access to .htaccess you should be able to make it 'think' that it is a .shtml page, but it depends on the type of file you want to include.
    I've played around with both PHP and CGI includes on static HTML pages - sometimes it works, other times it's a complete fiasco.
    There are a few good FAQs available on SSI, both for PHP and other scripting languages. It really depends on what you want it to do.
    If you can the simplest is to use an 'include' in a standard PHP page.


Advertisement