Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
0

how to insert php code into html pages

New Here ,
Feb 23, 2017 Feb 23, 2017

Copy link to clipboard

Copied

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

Views

859
Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 23, 2017 Feb 23, 2017

Copy link to clipboard

Copied

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

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 23, 2017 Feb 23, 2017

Copy link to clipboard

Copied

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.

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 23, 2017 Feb 23, 2017

Copy link to clipboard

Copied

LATEST

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 & Moderator

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines