Copy link to clipboard
Copied
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
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/
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.
Copy link to clipboard
Copied
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