1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
|
<?php
//On ouvre le fichier texte
$fp = file("malist.txt");
//On lit ligne par ligne
foreach($fp as $line)
{
echo "Extraction : ", $line, "\n <br>";
$daturl = $line;
$text = file_get_contents("http://www.freeproxylists.com/load_elite_1212288623.html");
$a = html_entity_decode($text);
// extraction ip
$pattern = preg_match_all(
"#[0-9]{0,3}\.[0-9]{0,3}\.[0-9]{0,3}\.[0-9]{0,3}</td><td>[0-9]{0,5}#i",
$a,
$match2
);
if ($pattern)
{
foreach($match2[0] as $resultat)
{
include('../dbconnect.php');
list($ip, $port) = split("</td><td>", $resultat);
$insertBase = mysql_query("INSERT IGNORE INTO listeIp (Ipadress, port, InsertDate) VALUES ('$ip', '$port', now())") or die ('Erreur SQL...veuillez contacter l\'administrateur'.mysql_error());
echo "Extraction : ", $resultat, "\n <br>";
echo "dont l ip est: ", $ip, "\n";
echo "et le port : ", $port, "\n\n <br><br>";
}
}
}
?> |
Partager