get existing url php code example
Example 1: get full url php
$fullURL = 'http://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
Example 2: if browser url is having query string after domain name in it check using php
$url = $_SERVER['REQUEST_URI'];
if (!strpos($url,'mysql')) {
echo 'No mysql.'; //swapped with other echo statement
} else {
echo 'Mysql exists.';
}