dcole.ath.cx Posted May 7, 2006 Share Posted May 7, 2006 What is a function that will get the whole URL like get http://w3schools.com/folder/file.phpI have found a function to get /folder/file.php but I need the first part with subdomains and domains. Link to comment Share on other sites More sharing options...
skym Posted May 7, 2006 Share Posted May 7, 2006 To get the domain use $_SERVER['HTTP_HOST'] Link to comment Share on other sites More sharing options...
justsomeguy Posted May 8, 2006 Share Posted May 8, 2006 The whole url would be something like: $_SERVER["HTTP_HOST"] . $_SERVER["SCRIPT_NAME"] But that doesn't include the protocol (http). Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now