I have the following code:
<?php
echo $_SERVER['HTTP_HOST'];
// CONFIGURATION ITEMS
$captcha_private_key = '';
$captcha_public_key = '';
switch ($_SERVER['HTTP_HOST']) {
case 'earth-neighbours.com' || 'www.earth-neighbours.com':
$captcha_private_key = '6Lcb_t4SAAAAALkdH4njSny2HYbrmGKS_G84kM_d';
$captcha_public_key = '6Lcb_t4SAAAAAPEtqJEcWXuo0zmRD5PxYkXx84R4';
echo 'live';
break;
case 'earth-neighbours.projects.mi24.net':
$captcha_private_key = '6Lca_t4SAAAAAJb5L4sA7fEHxDFA0Jl8jFw-h3hE';
$captcha_public_key = '6Lca_t4SAAAAAFd-Q2k8esFa9U8nQ2rirEZHFtAH';
break;
case 'earth-neighbours.local':
$captcha_private_key = '6LcZ_t4SAAAAAGc1_S9ahxo-Vg-e7QgHg4yAWBVU';
$captcha_public_key = '6LcZ_t4SAAAAAPHQDb_f-g4mS6mpmc0heustHQ60&hl';
echo 'local';
break;
}
?>
It's running on the local server (earth-neighbours.local) so should output 'local'. Instead it outputs 'live'. The echo at the top however (echo $_SERVER['HTTP_HOST'];) returns the url earth-neighbours.local so it should be 'local' that is echoed. This has me stumped. I had it working before and now I've shifted it to the top of the page and it doesn't work. Weird! Anyone?