Codice PHP:
<?
#
if (isset ($ _GET [ 'url']))
#
{ (
#
include ( "db.php" ) ; include ( "db.php");
#
mysql_connect ( $dbhost , $accountname , $password ) mysql_connect ($ dbhost, $ accountname, $ password)
#
or die ( "Could not connect to MySQL server" ) ; Or die ( "Impossibile collegarsi al server MySQL");
#
mysql_select_db ( $database ) or die ( mysql_error ( ) . "Could not select database" ) ; mysql_select_db ($ database) or die (mysql_error (). "Impossibile selezionare il database");
#
$file = file_get_contents ( $_GET [ 'url' ] ) ; $ file = file_get_contents ($ _GET [ 'url']);
#
$links = preg_split ( '/(href \= \' |href \= \" |href \= )/is' , $file ) ; $ link = preg_split ( '/ (href \ = \' | href \ = \ "| href \ =) / è ', $ file);
#
//$file=preg_replace('/(.*)(\ href\=\"|\ href\=\'|\ href=)(.*\ |.*\"|.*\'|.*>)/is','$2|^=^|',$file,1); / / $ file = preg_replace ('/(.*)( \ href \ = \ "| \ href \ = \ '| \ href =)(.* \ | .* \" | .* \'|.*> ) / è ',' $ 2 |^=^|',$ file, 1);
#
//echo $file."<br>"; / / echo $ file. "<br>";
#
#
mysql_query ( "INSERT INTO `indextemp` SET `url`='" . $_GET [ 'url' ] . "', `stage`='1'" ) ; mysql_query ( "INSERT INTO` indextemp `SET` url `= '". $ _GET [' url ']. "',` fase `='1 '");
#
$id = 1 ; $ id = 1;
#
while ( isset ( $links [ $id ] ) ) while (isset ($ link [$ id]))
#
{ (
#
$links [ $id ] = preg_replace ( "/([^ \' ]) \' (.*)/is" , '$1' , $links [ $id ] ) ; $ link [$ id] = preg_replace ("/([^ \ ']) \' è (.*)/ ", '$ 1', $ link [$ id]);
#
$links [ $id ] = preg_replace ( "/([^ \" ]) \" (.*)/is" , '$1' , $links [ $id ] ) ; $ link [$ id] = preg_replace ("/([^ \ "]) \" è (.*)/ ", '$ 1', $ link [$ id]);
#
$links [ $id ] = preg_replace ( "/([^ \> ]) \> (.*)/is" , '$1' , $links [ $id ] ) ; $ link [$ id] = preg_replace ("/([^ \>]) \> (.*)/ è ", '$ 1', $ link [$ id]);
#
$links [ $id ] = preg_replace ( "/([^ ]) \ (.*)/is" , '$1' , $links [ $id ] ) ; $ link [$ id] = preg_replace ("/([^]) \ (.*)/ è ", '$ 1', $ link [$ id]);
#
$links [ $id ] = preg_replace ( "/([^ \' ]) \' (.*)/i" , '$1' , $links [ $id ] ) ; $ link [$ id] = preg_replace ("/([^ \ ']) \' (.*)/ i ", '$ 1', $ link [$ id]);
#
$links [ $id ] = preg_replace ( "/([^ \" ]) \" (.*)/i" , '$1' , $links [ $id ] ) ; $ link [$ id] = preg_replace ("/([^ \ "]) \" (.*)/ i ", '$ 1', $ link [$ id]);
#
$links [ $id ] = preg_replace ( "/([^ \> ]) \> (.*)/i" , '$1' , $links [ $id ] ) ; $ link [$ id] = preg_replace ("/([^ \>]) \> (.*)/ i ", '$ 1', $ link [$ id]);
#
$links [ $id ] =@ preg_replace ( "/([^ ]) \ (.*)/i" , '$1' , $links [ $id ] ) ; $ link [$ id] = @ preg_replace ("/([^]) \ (.*)/ i ", '$ 1', $ link [$ id]);
#
#
$ifexists = mysql_query ( "SELECT * FROM `indextemp` WHERE `url`='" . $links [ $id ] . "'" ) ; $ ifexists = mysql_query ( "SELECT * FROM` indextemp DOVE `` `url = '". $ link [$ id]. "'");
#
if ( mysql_num_rows ( $ifexists ) == 0 && strlen ( $links [ $id ] ) > 16 ) if (mysql_num_rows ($ ifexists) == 0 & & strlen ($ link [$ id])> 16)
#
{ (
#
mysql_query ( "INSERT INTO `indextemp` SET `url`='" . $links [ $id ] . "', `stage`='0'" ) ; mysql_query ( "INSERT INTO` indextemp `SET` url `= '". $ link [$ id]. "',` fase `='0 '");
#
echo $links [ $id ] . "<br>" ; echo $ link [$ id] ". <br>";
#
} )
#
$id += 1 ; $ id + = 1;
#
} )
#
unset ( $links ) ; unset ($ link);
#
$continue = 1 ; continuare $ = 1;
#
while ( $continue = 1 ) while ($ continuare = 1)
#
{ (
#
#
$sqllinksa = mysql_query ( "SELECT * FROM `indextemp` WHERE `stage`='0'" ) ; $ sqllinksa = mysql_query ( "SELECT * FROM` indextemp »» DOVE fase `='0 '");
#
while ( $sqllinks = mysql_fetch_array ( $sqllinksa ) ) while ($ sqllinks = mysql_fetch_array ($ sqllinksa))
#
{ (
#
$file = file_get_contents ( $sqllinks [ 'url' ] ) ; $ file = file_get_contents ($ sqllinks [ 'url']);
#
$links = preg_split ( '/(href \= \' |href \= \" |href \= )/is' , $file ) ; $ link = preg_split ( '/ (href \ = \' | href \ = \ "| href \ =) / è ', $ file);
#
#
mysql_query ( "UPDATE `indextemp` SET `stage`='1' WHERE `url`='" . $sqllinks [ 'url' ] . "'" ) ; mysql_query ( "UPDATE indextemp` `` SET fase `='1 'DOVE` url `='". $ sqllinks [ 'url']. " '");
#
$id = 1 ; $ id = 1;
#
while ( isset ( $links [ $id ] ) ) while (isset ($ link [$ id]))
#
{ (
#
$links [ $id ] = preg_replace ( "/([^ \' ]) \' (.*)/is" , '$1' , $links [ $id ] ) ; $ link [$ id] = preg_replace ("/([^ \ ']) \' è (.*)/ ", '$ 1', $ link [$ id]);
#
$links [ $id ] = preg_replace ( "/([^ \" ]) \" (.*)/is" , '$1' , $links [ $id ] ) ; $ link [$ id] = preg_replace ("/([^ \ "]) \" è (.*)/ ", '$ 1', $ link [$ id]);
#
$links [ $id ] = preg_replace ( "/([^ \> ]) \> (.*)/is" , '$1' , $links [ $id ] ) ; $ link [$ id] = preg_replace ("/([^ \>]) \> (.*)/ è ", '$ 1', $ link [$ id]);
#
$links [ $id ] = preg_replace ( "/([^ ]) \ (.*)/is" , '$1' , $links [ $id ] ) ; $ link [$ id] = preg_replace ("/([^]) \ (.*)/ è ", '$ 1', $ link [$ id]);
#
$links [ $id ] = preg_replace ( "/([^ \' ]) \' (.*)/i" , '$1' , $links [ $id ] ) ; $ link [$ id] = preg_replace ("/([^ \ ']) \' (.*)/ i ", '$ 1', $ link [$ id]);
#
$links [ $id ] = preg_replace ( "/([^ \" ]) \" (.*)/i" , '$1' , $links [ $id ] ) ; $ link [$ id] = preg_replace ("/([^ \ "]) \" (.*)/ i ", '$ 1', $ link [$ id]);
#
$links [ $id ] = preg_replace ( "/([^ \> ]) \> (.*)/i" , '$1' , $links [ $id ] ) ; $ link [$ id] = preg_replace ("/([^ \>]) \> (.*)/ i ", '$ 1', $ link [$ id]);
#
$links [ $id ] = preg_replace ( "/([^ ]) \ (.*)/i" , '$1' , $links [ $id ] ) ; $ link [$ id] = preg_replace ("/([^]) \ (.*)/ i ", '$ 1', $ link [$ id]);
#
#
$ifexist = mysql_query ( "SELECT * FROM `indextemp` WHERE `url`='" . $links [ $id ] . "'" ) ; $ ifexist = mysql_query ( "SELECT * FROM` indextemp DOVE `` `url = '". $ link [$ id]. "'");
#
if ( strlen ( $links [ $id ] ) > 5 && mysql_num_rows ( $ifexist ) == 0 ) if (strlen ($ link [$ id])> 5 & & mysql_num_rows ($ ifexist) == 0)
#
{ (
#
mysql_query ( "INSERT INTO `indextemp` SET `url`='" . $links [ $id ] . "', `stage`='0'" ) ; mysql_query ( "INSERT INTO` indextemp `SET` url `= '". $ link [$ id]. "',` fase `='0 '");
#
echo $links [ $id ] . "<br>" ; echo $ link [$ id] ". <br>";
#
} else { unset ( $ifexists [ 'url' ] ) ; } ) Else (unset ($ ifexists [ 'url']);)
#
$id += 1 ; $ id + = 1;
#
} )
#
#
#
$ifexists = mysql_query ( "SELECT * FROM `indextemp` WHERE `url`='" . $links [ $id ] . "'" ) ; $ ifexists = mysql_query ( "SELECT * FROM` indextemp DOVE `` `url = '". $ link [$ id]. "'");
#
$ifexists = mysql_fetch_array ( $ifexists ) ; $ ifexists = mysql_fetch_array ($ ifexists);
#
if ( ! isset ( $ifexists [ 'url' ] ) && strlen ( $links [ $id ] ) > 5 ) if (! isset ($ ifexists [ 'url']) & & strlen ($ link [$ id])> 5)
#
{ (
#
mysql_query ( "INSERT INTO `indextemp` SET `url`='" . $links [ $id ] . "', `stage`='0'" ) ; mysql_query ( "INSERT INTO` indextemp `SET` url `= '". $ link [$ id]. "',` fase `='0 '");
#
echo $links [ $id ] . "<br>" ; echo $ link [$ id] ". <br>";
#
} )
#
} )
#
$checkcontinue = mysql_query ( "SELECT * FROM `indextemp` WHERE `stage`='0'" ) ; $ checkcontinue = mysql_query ( "SELECT * FROM` indextemp »» DOVE fase `='0 '");
#
if ( mysql_num_rows ( $checkcontinue ) == 0 ) if (mysql_num_rows ($ checkcontinue) == 0)
#
{ (
#
$continue = 0 ; continuare $ = 0;
#
break ; break;
#
} )
#
} )
#
// / /
#
} )
#
echo "<form><input type='text' name='url' size=50><input type='submit' value='index'></form>" ; echo "<input <form> type='text' name='url' size=50> <input type='submit' value='index'> </ form>";
#
?> ?>