Status
Not open for further replies.
11 comments
On Line 26, you didn't end the statement by semi-colon

PHP:
die('We cant find our link on your site, please add it.')

You need to add semi-colon

PHP:
die('We cant find our link on your site, please add it.');
 
it works as i planned, not bad for a noob. 1 prob, its not blacklisting heres m y code:

PHP:
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 (stripos($page,$ururl)===false) 
      return false; 
    else 
      return true;
}

$ururl = "http://warezrelease.org";

$reason = "Add our linkback, then email us.";

$date = date("d-m-Y");

  if(linkback($surl,$ururl)==true)
  {
mysql_query("INSERT INTO wcddl_queue (sid,title,type,url) VALUES ('".mysql_real_escape_string($sid)."','".mysql_real_escape_string($titles[$i])."','".mysql_real_escape_string($types[$i])."','".mysql_real_escape_string($urls[$i])."')");
  }
  else
  {
  die('We cant find our link on your site, please add it.');
   
  $b = mysql_query("INSERT INTO wcddl_blacklist VALUES ('".mysql_real_escape_string($surl)."','".mysql_real_escape_string($reason)."','".mysql_real_escape_string($date)."','".mysql_real_escape_string($email)."')");
  }

can some1 take a look.
 
Just a tip, this is redundant:

Code:
if(linkback($surl,$ururl)==true)

Should be:

Code:
if(linkback($surl,$ururl))

If the linkback() function returns true, it will evaluate the if statement to true, if it returns false, it will evaluate it to false. There's no need to do a comparison in the if statement.
 
got disconnected anyways u just called die() b4 adding site to blacklist :P just made a change. Look if this works

PHP:
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 (stripos($page,$ururl)===false) 
      return false; 
    else 
      return true;
}

$ururl = "http://warezrelease.org";
$date = date("d-m-Y");

  if(linkback($surl,$ururl))
  {
	mysql_query("INSERT INTO wcddl_queue (sid,title,type,url) VALUES ('".mysql_real_escape_string($sid)."','".mysql_real_escape_string($titles[$i])."','".mysql_real_escape_string($types[$i])."','".mysql_real_escape_string($urls[$i])."')");
  }
  else
  {
	mysql_query("INSERT INTO wcddl_blacklist VALUES ('".mysql_real_escape_string($surl)."','".mysql_real_escape_string($reason)."','".mysql_real_escape_string($date)."','".mysql_real_escape_string($email)."')");
	die('We cant find our link on your site, please add it.');
  }
 
oh yea, i fixed tht aready, btw when im displaying the error: (no linkback error) it shows succes msg too anyway to hide it?
 
Here's SS:

[slide]http://i25.lulzimg.com/46b15f.png[/slide]

the code for success msg: core->Output

the code for error msg: code->error

^^ submit.php

PHP:
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 (stripos($page,$ururl)===false) 
return false; 
else 
return true;
}

$ururl = "http://warezrelease.org";

$reason = "Add our linkback, then email us.";

$date = date("d-m-Y");

if(linkback($surl,$ururl)) {
mysql_query("INSERT INTO wcddl_queue (sid,title,type,url) VALUES ('".mysql_real_escape_string($sid)."','".mysql_real_escape_string($titles[$i])."','".mysql_real_escape_string($types[$i])."','".mysql_real_escape_string($urls[$i])."')");
} else {
$this->error .= 'We cant find our link on your site, please add it.';
mysql_query("INSERT INTO wcddl_blacklist (url,reason,dat,email) VALUES ('".mysql_real_escape_string($surl)."','".mysql_real_escape_string($reason)."','".mysql_real_escape_string($date)."','".mysql_real_escape_string($email)."')");
}

^^ funcs.php
 
any1 can tell me y am getting this errror wiv my code above:

[15-Aug-2011 23:55:51] PHP Fatal error: Cannot redeclare linkback() (previously declared in /home/warezrel/public_html/funcs.php:321) in /home/warezrel/public_html/funcs.php on line 321
 
any1 can tell me y am getting this errror wiv my code above:

[15-Aug-2011 23:55:51] PHP Fatal error: Cannot redeclare linkback() (previously declared in /home/warezrel/public_html/funcs.php:321) in /home/warezrel/public_html/funcs.php on line 321
That generally occurs when you add the function more then 1 times

For the file you are including use "include_once" or "require_once"

Or if that doesn't works then declare the function like this:

PHP:
if(!function_exists('Soft2050Function')) {  
function definesoft2050function() {
     // The blah shit of function   
} 
}

Regards
 
Last edited:
Status
Not open for further replies.
Back
Top