I have a dynamic page which produces a variable in the content that I want to insert into the page's header.
What's the best way to fetch this variable from the page content and put it into the header? I'd prefer a PHP solution.
Thanks!
I have a dynamic page which produces a variable in the content that I want to insert into the page's header.
What's the best way to fetch this variable from the page content and put it into the header? I'd prefer a PHP solution.
Thanks!
If your variable is dependent on client side information you'll have to capture that info and work with it in php. Unfortunately that means that you can't have a pure PHP solution, you'll have to have something on the client side (javascript: get/post).
If your variable client side independent, then potentially you can have it calculated prior to page load and use php to put it everywhere you like.
However, if you want to do this without reloading the page then php isn't an option you'll have to use javascript/AJAX to grab the variable from the body and move it to the header.