Greenguy's Board


Go Back   Greenguy's Board > Programming & Scripting
Register FAQ Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Rate Thread Display Modes
Old 2006-10-18, 08:42 AM   #1
oast
With $10,000, we'd be millionaires! We could buy all kinds of useful things like ... love!
 
oast's Avatar
 
Join Date: May 2004
Location: UK
Posts: 316
QuickDraw, kitty_kate:
My submission rules do not permit IP address URLs, so that is not an issue.

QuickDraw:
Thanks for the function. Yes it appears do what I want it to... in that it gets the domain name... but it still has the issue I mentioned in post 7, where it matches similarly named, longer domains.
  • 'http://www.greenguysboard.com' is listed in my database.
  • Someone comes along and submits the URL 'http://links.guyandjim.com'
  • The functions suggested (and the one I was using before) all (falsely) alert the submitter "a site from 'guyandjim.com' has already been added to our lists"
I am going to have to get the domain for each site I already have, update the database with a new 'domain' field, and then do exact matching on that field for future submissions.
__________________
Playboy Webmasters - The name says it all! $35 per signup or 60% revshare.
oast is offline   Reply With Quote
Old 2006-10-18, 09:06 AM   #2
Halfdeck
You can now put whatever you want in this space :)
 
Halfdeck's Avatar
 
Join Date: Oct 2004
Location: New Haven, CT
Posts: 985
Send a message via ICQ to Halfdeck
Code:
function base_domain($url) { // parse out subdomains
		
	$url = parse_url($url);
	$host = $url['host'];
		
	$pattern = "/([\-a-z0-9]*\.)?([\-a-z0-9]*)\.([a-z0-9]*)/i";
	preg_match($pattern, $host, $matches);
	$host = $matches[2] ."." .$matches[3];

	return $host;
}
Gotta be modified for stuff like .co.uk I guess.
__________________
Success is going from failure to failure without a loss of enthusiasm.

Last edited by Halfdeck; 2006-10-18 at 09:08 AM..
Halfdeck is offline   Reply With Quote
Old 2006-10-18, 12:07 PM   #3
oast
With $10,000, we'd be millionaires! We could buy all kinds of useful things like ... love!
 
oast's Avatar
 
Join Date: May 2004
Location: UK
Posts: 316
Quote:
Originally Posted by Halfdeck View Post
Gotta be modified for stuff like .co.uk I guess.
Yes, Halfdeck. Also does the same as the others that have been mentioned. Thanks anyway.
__________________
Playboy Webmasters - The name says it all! $35 per signup or 60% revshare.
oast is offline   Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 06:49 AM.


Mark Read
Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
© Greenguy Marketing Inc