# Php ftp pb

**URL:** <https://forum.kirupa.com/t/php-ftp-pb/119114>\
**Category:** Uncategorized\
**Created:** [August 11, 2004, 4:05pm UTC](https://forum.kirupa.com/t/php-ftp-pb/119114 "2004-08-11T16:05:39Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Uli](https://avatars.discourse-cdn.com/v4/letter/u/ccd318/32.png) [@Uli](https://forum.kirupa.com/u/Uli)\
**Post date:** [August 11, 2004, 4:05pm UTC](https://forum.kirupa.com/t/php-ftp-pb/119114/1 "2004-08-11T16:05:39Z")

</div>

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

<?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:
