SitePoint Sponsor

User Tag List

Results 1 to 2 of 2

Thread: FTP Problem

  1. #1
    SitePoint Enthusiast
    Join Date
    Apr 2001
    Posts
    50
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    FTP Problem

    Yet another PHP question here...

    Everytime I run this I get this error "Warning: error opening Data.tar in /home/wdeserv/public_html/ips_cpanelskin/v2/members.php on line 78" Line 78 is the ftp_put line. Code below..

    PHP Code:
                                    $ftpserver = $HTTP_POST_VARS["server"];
                                    $ftpusern = $HTTP_POST_VARS["ftpusern"];
                                    $ftppass = $HTTP_POST_VARS["ftppass"];

                                    $cid = ftp_connect($ftpserver); 
                                    $lresult = ftp_login($cid, $ftpusern, $ftppass);

                                    if ((!$cid) || (!$lresult)) {
                                        ?>
                                        <p>FTP connection failed.  Please check that your FTP server name, usernamem, and password are correct.</p>
                                        <?php
                                    
    }
                                        
    $dir "/public_html/";
                                        
    $sfile "Data.tar";
                                        
    $dfile "Data.tar";
                                        
    ftp_chdir($cid$dir);
                                        
    $upload ftp_put($cid$dfile$sfileFTP_BINARY);
                                        if (!
    $upload) {
                                            
    ?>
                                            <p>Upload Failed</p>
                                            <?php
                                        
    } else {
                                                
    ?>
                                                <p>File uploaded</p>
                                                <?php
                                            
    }

  2. #2
    SitePoint Enthusiast
    Join Date
    Apr 2001
    Posts
    50
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    All fixed..


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •