[thelist] PHP: getting domain names from a url - being foiled by .co.uk addresses
Williams, Olwen - SAL
Olwen.Williams at safeair.co.nz
Sun Dec 7 14:31:52 CST 2003
When you get to international domains in general it's going to be harder.
.tv and .cc are really country domains, and there are many others. (Tuvalu
and Cocos Islands).
The registrar for the country I think determines acceptable second level
domains.
In New Zeland we have:
.co.nz .org.nz .net.nz .iwi.nz .ac.nz .cri.nz .govt.nz .school.nz .mil.nz
.geek.nz
and maybe more
Australia has .com.au .net.au etc (I don't know the lot)
Other countries may or may not use second levels
Olwen Williams
olwen.williams at safeair.co.nz
-----Original Message-----
From: Tony Crockford [mailto:tonyc at boldfish.co.uk]
Sent: Sunday, December 07, 2003 10:15 AM
To: thelist at lists.evolt.org
Subject: Re: [thelist] PHP: getting domain names from a url - being
foiled by .co.uk addresses
On Sat, 06 Dec 2003 13:21:46 -0700, Ken Moore <psm2713 at hotmail.com> wrote:
>
> Not so tricky at all. Assuming that there are a set number of top-level
> domains (com, gov, net) and that there is a set number of characters
> (".", I think is the only one) that begin the TL name, do a string
> processing routine that looks for the "." and the TL domain such as
> "com". Take those four characters and all of the ones back to the "."
Well that would work except for the .uk.com type domains and the recent 7
new additions.
here's some of the trickier ones:
.co.uk
.org.uk
.me.uk
.com
.net
.org
.tv
.cc
.uk.com
.uk.net
.eu.com
.gb.com
.gb.net
.biz
.info
.name
.pro
.aero
.coop
.museum
couldn't you do a DNS look up and store the IP address instead?
http://uk.php.net/manual/en/function.gethostbyname.php
Maybe?
--
* * Please support the community that supports you. * *
http://evolt.org/help_support_evolt/
For unsubscribe and other options, including the Tip Harvester
and archives of thelist go to: http://lists.evolt.org
Workers of the Web, evolt !
____________________________________________________________________
CAUTION - This message may contain privileged and confidential
information intended only for the use of the addressee named above.
If you are not the intended recipient of this message you are hereby
notified that any use, dissemination, distribution or reproduction
of this message is prohibited. If you have received this message in
error please notify Safe Air Ltd immediately. Any views expressed
in this message are those of the individual sender and may not
necessarily reflect the views of Safe Air.
_____________________________________________________________________
For more information on the Safe Air Group, visit us online
at http://www.safeair.co.nz/
_____________________________________________________________________
More information about the thelist
mailing list