You have performed a query on a php
file, create an array and put the contents you want to display on the page, for example:
$data['titulo'] = "Aqui vai o título da página";
Place the contents you want, preferably the array is associative.
Then do the following:
extract($data, EXTR_PREFIX_ALL, "view");
Where $data
is its array
, EXTR_PREFIX_ALL
is a constant that says all its variables will have a prefix, and "view"
is the prefix that is a String
of your choice. p>
In this case, within your code html
, you should write like this:
<p><?php echo $view_titulo; ?></p>
Finally, in your code php
, after the command extract
you have to call one:
require_once "pagina.html";
That's how it works for me.
This W3Schools link can help: link