Skip to main content
Known Participant
February 23, 2017
Question

how to insert php code into html pages

  • February 23, 2017
  • 3 replies
  • 919 views

I was told it may be better for me to start a new discussion on each of the questions I asked in a prior thread titled: how to update hundreds of html bootstrap pages in Dreamweaver

Question:

How can I insert PHP code in HTML pages?

I see it is done. It does not seem to work for me.  My server does read PHP because I am able to insert PHP code in other PHP pages.

I will be using CC2017.

Thanks for your help.

PEOJ

    This topic has been closed for replies.

    3 replies

    Nancy OShea
    Community Expert
    Community Expert
    February 23, 2017

    It all depends on how your server is configured.  Most servers are not typically set-up to parse PHP scripts inside  HTML files because it puts extra strain on the server.  Asking the server to parse every HTML file as if it were a PHP file slows it down for everyone.  That's why many shared hosting plans won't allow it. Contact your web host.

    Nancy

    Nancy O'Shea— Product User & Community Expert
    Jon Fritz
    Community Expert
    Community Expert
    February 23, 2017

    It is best to go directly to your hosting company or IT department to have them make changes like this, they flat out may not allow it either way.

    Jon Fritz
    Community Expert
    Community Expert
    February 23, 2017

    On an Apache server, some will let you modify the .htaccess file: https://encodable.com/parse_html_files_as_php/