/    Sign up×
Community /Pin to ProfileBookmark

Submission form block subdomains and duplicate check

I have script right now that will allow you to submit your url for inclusion in a list of sites but has some hand ups

I would like to block all subdomain submissions and co.cc submissions

Also would like for it to check for duplicate urls right now it let you submit with www. and without counting as two different urls which is giving me problems.

I think the following is the code for checking for an absolute duplicate ie both exactly the same like “example.com” and “example.com” or “www.example.com” and “www.example.com”

Should accept either with or without the www. but also know if it either way has been added before.

[CODE]

$sql2 = “SELECT * FROM {$db_tp}pending WHERE `sample`=’$sample'”;

$query = $db->query($sql2);
if (@mysql_num_rows($query)==1)
$errors[] = ‘That site has been added already’;

$sql3 = “SELECT * FROM {$db_tp}sample WHERE `sample`=’$sample'”;

$query1 = $db->query($sql3);
if (@mysql_num_rows($query1)==1)
$errors[] = ‘That site has already been added to our database’;

$sample = strtolower($sample);

}
[/CODE]

To me it looks as though there are 2 checks here but both do the same thing. Not sure not enough knowledge to know.

Tried search for help on this via google looking for ways to block subdomain inclusions and I find nothing to be able to research this.

All help if it can be given is appreciated

to post a comment
PHP

1 Comments(s)

Copy linkTweet thisAlerts:
@mr_billauthorNov 12.2008 — Could some point me to a location to try and figure this out?
×

Success!

Help @mr_bill spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...