Hello I have many Domains and i want to add parking page for all domains for example " XYZABC,com is under construction" so how to grab domain from browser addressbar and show it on parking page Help Appreciate Thanks
You wouldn't be grabbing it "from the address bar" -- that's client side, you have ZERO access to that. What you would want to parse is the $_SERVER['REQUEST_URI'] (that's an I not an L) Run that through: http://php.net/manual/en/function.parse-url.php echo parse_url($_SERVER['REQUEST_URI'], PHP_URL_HOST); Code (markup):
Oh, and pay a good deal of attention to $_SERVER, there's a LOT of useful information you can do stuff with in there. http://php.net/manual/en/reserved.variables.server.php I parse REQUEST_URI a lot in my own code -- ever see people use .htaccess redirects to try and turn the URI into $_GET? Waste of time and needlessly complicated, and very fragile. Instead I use a whitelist of files to serve, redirecting all other files to my index.php to then parse out the path of REQUEST_URI, exploding it by slashes to use it that way. Has the nice side effect that you can mix getdata with the redirect, something the other approach cannot do.