Jump to content

essypowers

New Members
  • Posts

    3
  • Joined

  • Last visited

essypowers's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Guys thank you... the arry approach works perfectly @QuickOldCar - Puttig the HTML content in the final else container throws all kinds of syntax errors I am wondering is there is function that we can use to stop the scripy if the first IF statement is called... and if nothing is returned load the page... Thanks One last question... when i put the HTML code
  2. Thanks for the reply guys... @QuickOldCar This was great... I am seeing few issues When i use one IF statement... the message displays <?php $country_code = $_SERVER["HTTP_CF_IPCOUNTRY"]; $message = "Site Under Maintenance"; if ($country_code == "US") { echo $message; }else { } ?> But when I introduce the ELSEIF s the message no longer appears... @mac_gyver I ran $country_code = $_SERVER["HTTP_CF_IPCOUNTRY"]; echo "Country code is " . $country_code; and got the expected results, also as mentioned above one IF statement works like a charm ----
  3. Hi Guys... new to php... just signed up for CloudFlare and trying to use IP Geolocation any help would be appreciated... the goal is for the selected countries to show maintenance message. Otherwise show the content of the page this is what I have but its not working... <?php $country_code = $_SERVER["HTTP_CF_IPCOUNTRY"]; if ($country_code=="FR") { echo "Site Under Maintenance"; } elseif ($country_code=="UK") { echo "Site Under Maintenance"; } elseif ($country_code=="US") { echo "Site Under Maintenance"; } else { } ?> Thanks in advance
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.