Thread: Domain Keyword
View Single Post
Old 11-25-2007, 02:00 AM   #4 (permalink)
Andrew
The Acquainted
 
Join Date: Sep 2007
Location: Arizona
Posts: 114
Thanks: 10
Andrew is on a distinguished road
Default

Well, what you could do.. is just use explode. Make sure the domain is formatted like: www.domain.com.uk or whatever (without slashes or beginning http://), and then just do this:
PHP Code:
/* First get rid of http:// and trailing slash */
$szDomain 'www.domain.co.uk';
$szKeyword explode('.'$szDomain);
echo 
$szKeyword[2]; 
The only error I see this having, if they enter something like: www.sub.domain.com for example, but even then, they shouldn't have the www in front, so it would still work.
Send a message via AIM to Andrew Send a message via MSN to Andrew
Andrew is offline  
Reply With Quote