473,326 Members | 2,114 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

Detecting and displaying the domain name

Hi,

I have a site that has several domains pointing to its DNS.
I would like to implement a script that will grab the domain name visitors typed in, and display it
on the page. Is there a way to do it?
Thanks,

--
Charles.
Jul 17 '05 #1
4 23859

"Charles" <no*****@nothing.com> schreef in bericht
news:bq*************@ID-208473.news.uni-berlin.de...
Hi,

I have a site that has several domains pointing to its DNS.
I would like to implement a script that will grab the domain name visitors typed in, and display it on the page. Is there a way to do it?
Thanks,


$_SERVER['HTTP_HOST'] (use phpinfo() to lookup vars like this)
JW

Jul 17 '05 #2
Thanks, it's working fine. Is there a way to display only the name with www and extention such as:

- name

instead of

- www.name.com

Thanks again,

--
Charles.
Jul 17 '05 #3

"Charles" <no*****@nothing.com> schreef in bericht
news:bq*************@ID-208473.news.uni-berlin.de...
Thanks, it's working fine. Is there a way to display only the name with www and extention such as:
- name


Shure, per example with:

$name = ereg_replace(
"^(www.)?([^.]+).[^.]+$", "\\2",
$_SERVER['HTTP_HOST']
);
JW

Jul 17 '05 #4
Wow thank you very much Janwillem, you're very helpful.
Have a nice week-end,

--
Charles.
Jul 17 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Damon Morbius | last post by:
Is there a standard way to detect the device a visitor is using to access your site (i.e. Cell phone, handheld, web browser). Ultimately my goal is to detect what kind of device a visitor is using...
1
by: Luthor | last post by:
Hi, Say I'm on the site www.xyz.com and on a certain page if the user leaves the domain xyz.com, I have a popup cme up w/ stuff. I don't need to know what the new domain is, I just want to know...
1
by: Dave Parkinson | last post by:
Can anyone help. I'm new to Javascript so be gentle. I have 2 registered domains which are set up to redirect to my homepages which are on a different ISP. I have been told that it is possible to...
5
by: tdmailbox | last post by:
I have a form with a child form. In the child form there is a list of names that can grow quite large. On the parent form I want to display the first name from the child form. I set up a test...
9
by: D. Shane Fowlkes | last post by:
I'm using SQL Server 2000 and on my page, I'm simply creating a SQLDataReader and filling in Labels with the retrieved (single) record. However, how can I prevent from getting errors when a field...
2
by: naijacoder naijacoder | last post by:
I want to have a asp page that would be displaying different contents depending on the user that logged in. And the data would be populated from the Database! Any ideas on how to do this ***...
3
by: andrew sargent | last post by:
Hi, I have two domain names pointing to the same webspace, but i want them to be directed to seperate directories on the server: www.web1.com -> dir "Web1" www.web2.com -> dir"Web2" The...
1
by: Tuong | last post by:
I have a situation where i have a form that contains a webbrowser control. With this I was able to implement an application that can browse websites. One particular website i visited opens up...
1
by: Roshan | last post by:
Hi, I wanted a reliable way of detecting if a given NTAccount object represents a user account or group account. I was using SecurityIdentifier.IsAccountSid() method but this doesn't work as I...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.