Bonsoir,

Voilà, je suis entrain de créer un script pour checker des proxies.
Hors, j'y comprend un peu rien au boucle en PHP, je fais mon possible..

Voilà le code:

Code : Sélectionner tout - Visualiser dans une fenêtre à part
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
 
<?php 
 
//$_POST INFORMATIONS
$address = $_POST['address'];
 
if (!empty($_POST['address']))
{
 
//COMPTE LE NOMBRE D'ENTREES
$delimiter = $address;
$delimiterArray = ($delimiter != '')?explode(",",$delimiter):NULL;
$arrayCount = count($delimiterArray);
 
for ($i = 1; $i <= $arrayCount; $i++) {
 
$url = 'http://api.proxyipchecker.com/pchk.php';
 
//DELIMITE L'IP ET PORT
$format = explode(":", $address);
$ip = $format[0];
$port = $format[1];
 
//CURL
$ch = curl_init();
 
curl_setopt($ch,CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS,'ip='.$ip.'&port='.$port);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
 
list($res_time, $speed, $country, $type) = explode(';', curl_exec($ch));
 
//REMPLACE LE RESULT
if (isset($type))
{
    if ($type >= 4 or $type <= 0)
    {
       $type = "Undefined";
    }
	elseif ($type = 1)
	{
       $type = "Transparent";
    }
    elseif ($type = 2)
	{
       $type = "Anonymous";
    }
    elseif ($type = 3)
	{
       $type = "High anonymous";
    }
}
 
//ECHO RESULT
 
echo $ip.":".$port." / Response time: ".$res_time." seconds / Country ".$country." / Type ".$type."\n";
 
 }
}
L'erreur est ici

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
 
//DELIMITE L'IP ET PORT
$format = explode(":", $address);
$ip = $format[0];
$port = $format[1];
Car vu que c'est une boucle mettre des [0], [1] sa va être bon pour le premier, et puis sa va faire un offset..
Si quelqu'un a une idée, merci beaucoup!