PHP/FTP Module failing to parse lines on remote account.

Discussion in 'PHP' started by digitaldude, Feb 9, 2008.

  1. #1
    I build a PHP/MySQL sytem that takes a PHP website with a database and installs it for a user. Just using session and $key data, it takes the users information, writes the config file, uploads the files to their server and runs an installer file to create tables and populate the tables.

    For some reason, it cannot connect to a remote server account. It connects to an account on my server fine though.

    It appears to stalls out and I get the following error:

    Warning: Invalid argument supplied for foreach() in /home/procom/public_html/go/members/installer/ftp.php on line 99

    PHP is 4.4.6, FTP module is compiled. It was initiall working through testing phases but crashed several days ago. No server updates that should effect it.

    I installed the script on a HostGator shared account I have for testing and connects to several remote servers and itself fine. Even my server. So the issue is either a compile problem of maybe a conflict somewhere.

    Grrrr....


    Thanks. Here's the code:

        
    foreach ($listing as $line) {
          $fileinfo = parse_line($line);
          if ($fileinfo[0]) {
    	  
    	  if ($fileinfo[2] == "public_html" || $fileinfo[2] == "wwwroot" || $fileinfo[2] == "http_docs" || $fileinfo[2] == "/var/www/html/" || $fileinfo[2] == "www"){
    	  $fontcolor = "#006600";
    	  $fontcolor2 = "#000000";
    	  $storng = "<strong>";
    	  $endstrong = "</strong>";
    	  $messag = "< - Root Accessible Folder";
    	  }else{
    	  $fontcolor = "#908E84";
    	  $fontcolor2 = "#656358";
    	  $messag = "";
    	  $storng = "";
    	  $endstrong = "</strong>";
    	  }
            print "<a href=info.php?dir=$directory/$fileinfo[2]>$storng<font color=$fontcolor2>Install -></font>$endstrong</a> ";
            print "<a href=ftp.php?directory=$directory/$fileinfo[2]>$storng<font color=$fontcolor>$fileinfo[2]</font>$endstrong</a> $messag";
            print "<br>\n";
          }
        }
    Code (markup):
     
    digitaldude, Feb 9, 2008 IP
  2. daman371

    daman371 Peon

    Messages:
    121
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Try this.

    
    foreach ($listing as &$line)
    
    PHP:
     
    daman371, Feb 10, 2008 IP