Results 1 to 10 of 24
Hybrid View
-
7th Apr 2011, 05:24 PM #1OPBannedWebsite's:
WarezRelease.org ThatHosting.coSelf Whitelisting Help
hi
Basicly ive added a whitelist page on my site and ive added a self whitelisting form,box nd buton so people can add sites anytime, heres my code so far:
<?php
$connect = mysql_connect ("localhost", "user", "pass") or die ('Connection Fail!');
mysql_select_db("xtremedd_wcddl", $connect) or die ('lol');
$add = mysql_query("INSERT INTO wcddl_whitelist VALUES ('$addsiteurl')");
echo "Connected!"
?>
can some1 correct me..Chris2k Reviewed by Chris2k on . Self Whitelisting Help hi Basicly ive added a whitelist page on my site and ive added a self whitelisting form,box nd buton so people can add sites anytime, heres my code so far: <?php $connect = mysql_connect ("localhost", "user", "pass") or die ('Connection Fail!'); mysql_select_db("xtremedd_wcddl", $connect) or die ('lol'); Rating: 5
-
7th Apr 2011, 05:30 PM #2Retired NinJaWebsite's:
loledhard.comwell lets go in algorithmic path...
- Check if that site is already whitelisted or not.
- If not whitelisted, chk the site for link back.
If whitelisted display "Already in Whitelist". - If linkback found, add to whitelist table
If no link back, display "No Link Back"
lets code it....
PHP Code:$sitename = $_POST['sitename'];
$connect = mysql_connect ("localhost", "user", "pass") or die ('Connection Fail!');
mysql_select_db("xtremedd_wcddl", $connect) or die ('lol');
$x = mysql_query("select count(*) from wcddl_whitelist where sitename = ".trim($sitename));
if ($x==1)
{
die ("Already Whitelisted");
}
elseif ($x==0)
{
//curl_part to retrieve content from the said sitename & chk for link back
if($linkback==true)
{
$add = mysql_query("INSERT INTO wcddl_whitelist VALUES ('".$sitename."')");
echo "Whitelisted!"
}
else
{
die('No Link Back');
}
}
Hope this helps
u have to still write in curl part in that code. where i have commented //curl_part
You don't hate Justin bieber.You hate the fact you ain't Justin Bieber!
-
9th Apr 2011, 01:36 PM #3OPBannedWebsite's:
WarezRelease.org ThatHosting.coyes humour thats wot im aiming for m8.
__________________
Added after 1 Day 19 Hours:
ok here what i got;
Code:<?php $siteurl = $_POST['siteurl']; $connect = mysql_connect ("localhost", "user", "p/w") or die ('Connection Fail!'); mysql_select_db("xtremedd_wcddl", $connect) or die ('Database not found!'); $check = mysql_query("select count(*) from wcddl_whitelist where url = ('$siteutl')"); if ($check==1) { die ("Already Whitelisted"); } elseif ($check==0) { { $add = mysql_query("INSERT INTO wcddl_whitelist (`url`) VALUES ('$siteurl')") or die ("Unable"); echo "Connected!" } } ?>
Parse error: syntax error, unexpected '}', expecting ',' or ';' in /home/xtremedd/public_html/addme.php on line 21
any1 can help?
updated with error
-
9th Apr 2011, 01:40 PM #4Retired NinJaWebsite's:
loledhard.comecho "Connected!"
add semicolon at end
You don't hate Justin bieber.You hate the fact you ain't Justin Bieber!
-
9th Apr 2011, 01:49 PM #5OPBannedWebsite's:
WarezRelease.org ThatHosting.codid tht humour, now no error shows jus a blank page and the cccode isnt worrkin
-
9th Apr 2011, 02:34 PM #6Respected MemberWebsite's:
DL4Everything.com Soft2050.inI haven't tried it yet.
But in ur edited php code. there's a error. Will install wcddl to check it.
On line 9
PHP Code:$check = mysql_query("select count(*) from wcddl_whitelist where url = ('$siteutl')");
PHP Code:$check = mysql_query("select count(*) from wcddl_whitelist where url = ('$siteurl')");
-
9th Apr 2011, 02:47 PM #7OPBannedWebsite's:
WarezRelease.org ThatHosting.codone it, here my final code;
Code:<?php $siteurl = $_POST['siteurl']; $connect = mysql_connect ("localhost", "user", "p/w") or die ('Connection Fail!'); mysql_select_db("xtremedd_wcddl", $connect) or die ('Database not found!'); $check = mysql_query("select count(*) from wcddl_whitelist where url = ('$siteurl')") or die ("Already Whitelisted"); // Checks the whitelist to see if ur URL is already there. $add = mysql_query("INSERT INTO wcddl_whitelist (`url`) VALUES ('$siteurl')") or die ("Already Whitelisted"); echo "You have been added to the whitelist!" ?>
-
9th Apr 2011, 03:03 PM #8Retired NinJaWebsite's:
loledhard.comlink back part should be easy, lets make a function to return true or false based on linkback
PHP Code:function linkback($link, $ururl)
{
$ch = curl_init($link);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_USERAGENT, 'Opera/9.80 (Windows NT 5.1; U; en) Presto/2.7.62 Version/11.01');
$page = curl_exec($ch);
curl_close($ch);
if (strpos($page,ururl)===false)
return false;
else
return true
}
You don't hate Justin bieber.You hate the fact you ain't Justin Bieber!
-
9th Apr 2011, 03:10 PM #9Member
I guess if the link back are commented will be accepted too
<!--LINK to Site--> //are accepted
Try always validate the users input data, never forget to safe the query's
PHP Code:$siteurl = $_POST['siteurl']; //need be in http
$siteurl = parse_url(trim($siteurl)); //remove spaces split the url
$siteurl = $siteurl['host']; //get host
$siteurl = str_replace("www.","",$siteurl); //remove the www
$ipAddress = gethostbyname($siteurl);
if($ipAddress === $siteurl) //validate if real the site exists
INSERT INTO wcddl_whitelist (`url`) VALUES ('$siteurl')
INSERT INTO wcddl_whitelist (`url`) VALUES ('".mysql_real_escape_string($siteurl)."') //avoiding the sql injections are always an good idea
-
9th Apr 2011, 03:13 PM #10Retired NinJaWebsite's:
loledhard.com^
Have u just copy pasted it or something, y would one need to know the IP ?
this part is helpful thou coz WCDDL saves hostname only
PHP Code:$siteurl = $_POST['siteurl']; //need be in http
$siteurl = parse_url(trim($siteurl)); //remove spaces split the url
$siteurl = $siteurl['host']; //get host
You don't hate Justin bieber.You hate the fact you ain't Justin Bieber!
Sponsored Links
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Similar Threads
-
Whitelisting with Zunox Help
By blankshare in forum Technical Help Desk SupportReplies: 2Last Post: 13th Dec 2011, 02:01 AM -
Mechoddl whitelisting
By lukip006 in forum Forum and DDL DiscussionReplies: 2Last Post: 3rd Jul 2011, 09:14 AM -
[Buying] Need WCDDL mod (Self Whitelisting)
By mannNmeet in forum Completed TransactionsReplies: 1Last Post: 24th Apr 2011, 09:16 AM -
[Official] DDL0.com Whitelisting & Re-Rating (Apply Here)
By SJshah in forum Forum and DDL DiscussionReplies: 220Last Post: 1st Feb 2011, 12:16 AM -
Whitelisting.
By CyberPirate in forum Forum and DDL DiscussionReplies: 9Last Post: 4th Mar 2010, 11:12 AM
themaPoster - post to forums and...
Version 5.35 released. Open older version (or...