Underc0de

Foros Generales => Dudas y pedidos generales => Mensaje iniciado por: coding++ en Octubre 23, 2011, 03:57:32 PM

Título: Ayuda con este code !
Publicado por: coding++ en Octubre 23, 2011, 03:57:32 PM
Código (php) [Seleccionar]

<?php 
set_time_limit ); 
error_reporting ); 
ini_set 'memory_limit' '128M' ); 

if (isset ( 
$_POST['search']))

$thisdork $_POST['dork']; 
$frompage intval $_POST['frompage']); 
$topage intval $_POST['ftopage']); 
$item1 = ( $frompage )* 10 
$item2 = ( $topage )* 10 
$templinks = array(); 
$links = array(); 
$finalinks = array(); 
$gurl str_replace ' ' '+' "http://www.google.com/search?q= $thisdork &start=" ); 
for ( 
$i $item1 $i <= $item2 $i += 10 

$thispage connecturl $gurl $i ); 
preg_match_all "/<h3 class=(.*?)><a href=\"(.*?)\" class=(.*?)>/" $thispage $templinks ); 
foreach ( 
$templinks as $thislink 
if ( 
validateurl $thislink )) 
array_push $links $thislink ); 

$linkscount count $links ); 


function 
connecturl $url 

$ch curl_init (); 
curl_setopt $ch CURLOPT_FOLLOWLOCATION ); 
curl_setopt $ch CURLOPT_HEADER ); 
curl_setopt $ch CURLOPT_URL $url ); 
curl_setopt $ch CURLOPT_RETURNTRANSFER ); 
curl_setopt $ch CURLOPT_TIMEOUT 30 ); 
$data curl_exec $ch ); 
if( 
$data 
return 
$data 
else 
return 



function 
validateurl $url 

if ( 
preg_match '@^(?:http://)?(;^/;+)@i' $url )) 
return 

else 
return 


?>


<html>
<head>
<title>Google Dork Finder</title>
</head>
<body>
<form method="POST" action=" <?php $_SERVER PHP_SELF ;; ?> ">
<p>Dork: <input type="text" name="dork" size="30"></p>
<p>Pages from <input type="text" name="frompage" size="5" value="1"> to <input type="text" name="topage" size="5" value="5"></p>
<p><input type="submit" value="Dork It!" name="search"><input type="reset" value="Reset" name="reset"></p>
<p>
<?php 
if (isset ( $_POST['search'])) { 
echo 
$linkscount links found:" 
echo 
'<p><textarea rows="30" name="linkslist" cols="100" readonly>' 
foreach ( 
$links as $a 
echo 
$a "\r\n" 
echo 
'</textarea></p>' ; } ?>

</form>
</body>
</html>
?>


¿Qué esta mal que no lo hace conectar?