To get the current url in PHP you can use the following snippet.
Sample PHP
function GetCurrentUrl() { $currentUrl = isset( $_SERVER['HTTPS'] ) && 'on' === $_SERVER['HTTPS'] ? 'https' : 'http'; $currentUrl .= '://' . $_SERVER['SERVER_NAME']; $currentUrl .= in_array( $_SERVER['SERVER_PORT'], array('443','80') ) ? '' : ':' . $_SERVER['SERVER_PORT']; $currentUrl .= $_SERVER['REQUEST_URI']; return $currentUrl; }
RT @CodeSnippetsNET: How to get the current url in #PHP http://t.co/kQCT8azSDm #html #css #js #coding #code #programming