1

on my site the topbar, menu and footer as php include instruction in html, is not working for the *.html files only the index.html

In the chrome inspector i see that de php include is shown as command! when is rename the agenda.html -> agenda.php the php_menu, php_topbar and php_footer are working again

in the past i have to put a "addhandler" in the ".htaccess"

How can i make al html to run as a php


index.html

<!--Top bar start-->
<?php
    include 'php_topbar.php';
?>

php_footer.php

https://www.sportenmoedig.be/php_footer.php


php version: https://sportenmoedig.be/version.php

Current PHP version: 7.3.23


.htaccess

AddHandler application/x-httpd-php .php .htm .shtml .html


ikirkels
  • 11
  • 2
  • 1
    Does this answer your question? [Using .htaccess to make all .html pages to run as .php files?](https://stackoverflow.com/questions/4687208/using-htaccess-to-make-all-html-pages-to-run-as-php-files) – A. Meshu Nov 11 '20 at 23:06

2 Answers2

-1

You can't use <?php ?> tags in html page, <?php ?> working only in php file. You can change index.html to index.php

Mike Foxtech
  • 1,633
  • 1
  • 6
  • 7
-1

The opening of PHP script is <?php and the closing will be ?>

Outside of these tags, you will be able to insert your html. This means that any page that you want to use PHP in you should name a .php file.

This source will help you understand how PHP and HTML can be used together:

https://www.w3schools.com/php/php_syntax.asp