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.
Need help identifing the URL used to pull up a web page.
Moderator: General Moderators
-
DennisHenry
- Forum Newbie
- Posts: 1
- Joined: Sat Mar 22, 2008 5:20 pm
Re: Need help identifing the URL used to pull up a web page.
start with:
Code: Select all
echo htmlspecialchars($_SERVER['HTTP_HOST']);