kolum Posted August 12, 2014 Share Posted August 12, 2014 Hi, I would like to generate a constant value that change from a website to website but have an identical value for a single website. For example $_SERVER['SERVER_ADDR'] doesn't change for a single website, but easy to guess. an other idea is realpath(dirname(__FILE__)) but this can change if the web application execute scripts located in sub directories of the main script that use this variable. So what other possibilities to get a constant value that doesn't change ? Thank you. Quote Link to comment https://forums.phpfreaks.com/topic/290408-ideas-to-generate-a-constant-value/ Share on other sites More sharing options...
CroNiX Posted August 12, 2014 Share Posted August 12, 2014 It might help to know the purpose. What will it be used for that shouldn't be "easy to guess"? Quote Link to comment https://forums.phpfreaks.com/topic/290408-ideas-to-generate-a-constant-value/#findComment-1487488 Share on other sites More sharing options...
ginerjm Posted August 12, 2014 Share Posted August 12, 2014 Yes - this is a very confusing question. "A Constant value that doesn't change"? What a misnomer - a constant is Exactly that - a constant. To ask for "a constant that doesn't change" is simply idiotic. So - as Cronix says - "What are you really looking for?". Quote Link to comment https://forums.phpfreaks.com/topic/290408-ideas-to-generate-a-constant-value/#findComment-1487509 Share on other sites More sharing options...
mogosselin Posted August 12, 2014 Share Posted August 12, 2014 I would like to generate a constant value that change from a website to website but have an identical value for a single website. Like the website URL? $_SERVER['REQUEST_URI'] Like others said, it's not really clear what you want to acheive. Do you need something so that you can hardcode conditions in a development/test/production website? Quote Link to comment https://forums.phpfreaks.com/topic/290408-ideas-to-generate-a-constant-value/#findComment-1487604 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.