Hello,
I’m building a tool for work that checks if the webservers are online by connecting to their ftp…
I’m sending a bunch of variable from flash (sendAndLoad using post)
myport0=21&myip0=255%2E255%2E255%2E255&myid1=12
myport1=21&myip1=192%2E168%2E255%2E255&myid1=12
myport2=21&myip2=195%2E255%2E122%2E255&myid1=12
myport3=21&myip3=255%2E255%2E255%2E255&myid1=12
myport4=21&myip4=255%2E255%2E255%2E255&myid1=12
myport5=21&myip5=255%2E255%2E255%2E255&myid1=12
…
myport11=21&…
I have myid1=12 repeating cause its stuck in the loop but as it never changes, so i bet it’s alright… i have 12 connections to make so i do:
<?php
//Capture data from $_POST array
$id = urldecode($_POST['myid1']); //should be 12
// Capture data from $_POST array and make a multiple ftp connection
for ($p = 0 ; $p < $id ; $p++){
$ip$p = urldecode($_POST['myip$p']);
$port$p = urldecode($_POST['myport$p']);
$con$p = ftp_connect($ip$p , $port$p );
$login_result = ftp_login($con$p,"check","check");
if ((!$login_result$p) || ($login_result$p)) {
echo "sending$p=0";
} else {
echo "sending$p=1";
} ftp_close($con$p);
}
?>
But it seems to have a pb there: $con$p = ftp_connect($ip$p , $port$p );
Could someone tell me what i’m doing wrong??
Thanks :))
:p: