Forum Moderators: coopster
After all, since we have no need to parse HTML as PHP except to run this script, I wonder if we could make a call to that PHP script from .htaccess. That would leave our HTML with no PHP inside, plus no dirty URLs.
Thanks
Actually, you can, by using
php_value auto_prepend_file "/path/to/file.php
Thanks so much. Is it that simple, or it requires more than that line? Do you do any changes on the server level or you can use it on shared hosting?
I wonder why this method is so unknown. Search on Google always gives "parsing HTML as PHP".
There are so many cases where you want to load something once only.
There's a similar directive to automatically.... um... "append" a file? I disremember the name or syntax, but it calls the specified file after the initial request is processed. The two together are sometimes used to include a header and footer on every page.
Now, about this directive in general, would you expect it to work on a load of static HTML files or PHP only?
It should work in php.ini. There's more info in the php manual [us.php.net]
Anyhow, I resolved that, but the nature of PHP cookie (not written on first page access) is something that creates an obstacle for me. I need cookie to be loaded right away. Here is the post:
[webmasterworld.com...]