Page 1 of 1

Need help identifing the URL used to pull up a web page.

Posted: Sat Mar 22, 2008 5:24 pm
by DennisHenry
I'm not a php programmer, but do understand programming logic and html. Here's what I need help on.

Let's say I pull up a web page using the url: "NEBRASKA-TOOLS.COM". I want to use php embedded in the index page to identify the url, then print out a specific word base on the url.

For example if the url is NEBRASKA-TOOLS.COM, i'd like $urlcity = "Nebraska" and then i'd like to echo the $urlcity thoughout the webpage.

Need help with the code to pull this off.

Re: Need help identifing the URL used to pull up a web page.

Posted: Sat Mar 22, 2008 9:02 pm
by Weirdan
start with:

Code: Select all

 
echo htmlspecialchars($_SERVER['HTTP_HOST']);