954,587 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

How To Hide Report Deadlink from Bots?

I want to report deadlinks on my site, my current script does work but it allows search engine bots to click the dead link report which makes it hard for me to determine which reports are form visitors and which are from bots.

What am I doing wrong here?
As the bots are still able to click the link and send the report to me.

Any help is much appreciated
Thanks.

$x=$_GET['Deadlink'];
$agent=$_GET['agent'];

$bots = array(
'bing' => 'http://onlinehelp.microsoft.com/en-us/bing/gg132928.aspx', 
'yahoo' => 'http://help.yahoo.com/help/us/ysearch/slurp', 
'google' => 'http://www.google.com/support/webmasters/bin/answer.py?answer=182072',
'ask'=>'http://www.ask.com/questions-about/Webmaster-Tool',
);
$agent = strtolower($_SERVER['HTTP_USER_AGENT']);
foreach( $bots as $name => $bot)
{
    if(stripos($agent,$bot)!==false)
    {
        echo $name;
		echo"Sorry, No Link or Data";
    }
}    

if($x==1 && $agent !==true){
{ 
 $to="admin@blitz-labs.com \r\n";
 $subject.="Dead Link Reported \r\n";
 $message.="url link \r\n";
 $message.=" IP address :".$_SERVER["REMOTE_ADDR"]."\r\n";

	echo "Thank you for Reporting the Deadlink! We will rewview the link and repklace it if nesseart";
  } 
else 
{
/////NOT SURE HOW TO MAKE THIS WORK /////
$agent = strtolower($_SERVER['HTTP_USER_AGENT']);
foreach( $bots as $name => $bot)
{
    if(stripos($agent,$bot)!==false)
    {
        echo $name;
        echo"Sorry, No Link or Data";
    } 
/////////////////////////////////////////////
echo "Link not loading or broken.  Why not ";
	echo"<a href='?Deadlink=1&agent=false>Report Deadlink?</a>";
}
Blitz-labs.com
Newbie Poster
12 posts since May 2010
Reputation Points: 10
Solved Threads: 0
 

sorry this doesnt exist in the scirpt sorry

/////NOT SURE HOW TO MAKE THIS WORK /////$agent = strtolower($_SERVER['HTTP_USER_AGENT']);foreach( $bots as $name => $bot){    if(stripos($agent,$bot)!==false)    {        echo $name;        echo"Sorry, No Link or Data";    } /////////////////////////////////////////////
Blitz-labs.com
Newbie Poster
12 posts since May 2010
Reputation Points: 10
Solved Threads: 0
 

If you amended your notification links to have their own subdirectory, to something like:

<a href="/report/dead?id=123" title="Report dead link">Report dead link</a>


Then you could use a robots.txt file to exclude the /report directory. This should stop robots from indexing any page in that directory.

R.

blocblue
Posting Pro in Training
475 posts since Jan 2008
Reputation Points: 142
Solved Threads: 79
 

thanks for the reply sorry I took so long to reply.

Blitz-labs.com
Newbie Poster
12 posts since May 2010
Reputation Points: 10
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: