How can I output data from the database in the html file? That is, index.html is loaded first and in it is a table with data from the database.

Update Thank you, I will do so.

  • Is it possible to assign a PHP interpreter to the html file as a processor, for example, using Apache tools? - cheops
  • No, the result will be given, no manipulations with the server should be - O.Vykhor
  • If you are approached by one of the answer options, you need to check the box opposite it. this will show the rest of the user that the question is closed. - toxxxa

2 answers 2

UPD: corrected, did not immediately understand the question.

Create this html using php:

http://site/index.php?html=page1 

And so that for the visitor it looks like the html page, register in .htaccess :

 RewriteEngine on RewriteRule ^(.*)\.html$ /index.php?html=$1 [nc] 

And then when opening http://site/page1.html it will be redirected to http://site/index.php?html=page1

    How can I output data from the database in the html file?

    in the apache server settings, set the html as the resolution of the files processed by php

     AddType application/x-httpd-php .php .php5 .html 

    You can also do this using the .htaccess file. Add or edit an existing line like this:

     AddType application/x-httpd-php .php .phtml .php4 .html