I want to set up some constants using PHP's define() function to use in HTML pages. I thought I knew how to do this, but I'm missing something. I assumed you could simply create a file of defines, let's say it's called "global.php," and might look like this:
And in a separate HTML file, I thought it was supposed to be done something like this:
(Imagine this text is in an HTML file)
Wherever you see the constant name, it would be replaced by the definition, like if I type {_1WEEK}, you'll see it replaced with the text defined for that name, so it would say "1 week" there instead.
I have tried several things, but I don't seem to be able to do it. Basically, I just want to be able to create a separate file of constants, call it to my HTML pages, and have it replace the constant name with the text I define it as. Do I need some sort of small script to get this to work? It seemed simple enough, but I'm just guessing from seeing it used in some CMS scripts (like PHP-Nuke). Can someone tell me how to do this, and what I use (such as php include() or require() ) to call the file? Thanks.