Category Archives: PHP

PHP – Redirect based on referrer or IP address

Redirect based on referrer or IP address Referrer — Code Example  —————————————- <?php $referrer = $_SERVER[‘HTTP_REFERER’]; if (preg_match(“/Google.com/”,$referrer)) {       header(‘Location: http://www.google.com); } elseif (preg_match(“/yahoo.com/”,$referrer)) {       header(‘Location: http://www.yahoo.com); } else {       header(‘Location: http://www.connectiveinnovations.com); }; ?> ———————————–  IP Address  — Code Example  … Continue reading

Posted in PHP | Leave a comment

PHP – If-Else Code statement

If Else PHP Code example — Code —————————— <?php if ($a > $b) { echo “a is bigger than b”; } elseif ($a == $b) { echo “a is equal to b”; } else { echo “a is smaller than … Continue reading

Posted in PHP | Leave a comment