<?php
set_time_limit(3600);
if($_SERVER['REQUEST_METHOD']=='POST') {
if(!empty($_POST['ftp'])) {
$ftps=explode("\n",trim($_POST['ftp']));
$good=$bad=array();
$a=0;
$count=sizeof($ftp);
while($a<$count) {
$ftps[$a]=trim($ftps[$a]);
$data=explode('||',$ftps[$a]);
echo 'connect to:'.$data[0].' uname:'.$data[1].' pass:'.$data[2];
flush();
$conn_id=ftp_connect($data[0]);
if(!$conn_id) {
echo ' can\'t connect<br>';
flush();
$bad[]=$ftps[$a];
$a++;
continue;
}
else {
$login_result=ftp_login($conn_id,$data[1],$data[2]);
if (!$login_result) {
echo ' can\'t login<br>';
flush();
$bad[]=$ftps[$a];
$a++;
continue;
}
}
echo ' connected<br>';
flush();
$good[]=$ftps[$a];
$a++;
}
}
echo '<br><br>good:<br>'.implode('<br>',$good).'<br><br>bad:<br>'.implode('<br>',$bad).'<br><br>';
flush();
}
echo <<<txt
<form action="" method="POST">
format:server||uname||pass<br>
<textarea rows="20" cols="50" name="ftp"></textarea>
<input type="submit">
txt;
?>