Skip to content
Advertisement

pull data from page without database

I am making a php site without using a database. I add the header and footer to the page with the include function.

How can I dynamically create meta tags by pulling information from inside the page.

JavaScript

Advertisement

Answer

The point is: first, define your php variables; then use them when needed. for example

in the "inc/head.php"file define the variables so you can access them later like

JavaScript

so now you can set your h1 context like

JavaScript
User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement