php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #5471 ftp_login warning message produced when it shouldn't be
Submitted: 2000-07-08 21:36 UTC Modified: 2000-08-05 00:55 UTC
From: kevfinn at epitaph dot com Assigned:
Status: Closed Package: Misbehaving function
PHP Version: 4.0 Latest CVS (08/07/2000) OS: RedHat Linux 6.1
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: kevfinn at epitaph dot com
New email:
PHP Version: OS:

 

 [2000-07-08 21:36 UTC] kevfinn at epitaph dot com
I have the ftp functions working with my PHP 4.0.1pl2 setup but I'm running into an error message that is produced when it should not be.  

The problem arises with FTP logins exceed the specified simultaneous connections allowed by my server (by way of the /etc/ftpaccess file).  When connecting to an FTP server that has exceeded the number of connections, ftp_connect connects, just as a command line FTP session would, but ftp_login fails (a command line FTP session would return the warning message provided by the server that the maximum number of connections has been exceeded), but the documentation states that ftp_login would return a false value upon failure.  Instead it returns the error message :
"Warning: ftp_login: Login incorrect. in /usr1/websites/epitaph.com/htdocs/temp/ftp.php on line 5"
Had it returned a zero as specified in the documentation, then I could produce an appropriate error message, instead I do not have that ability.  Here's the sample code that I was working with :

<?PHP
        $ftp    = ftp_connect ( "skunk.epitaph.com" );

        if ( ftp_login ( $ftp, 'anonymous', 'test@epitaph.com' ) )
        {
                echo "yep";
        }
        else
        {
                echo "nope";
        }
 
        ftp_quit ( $ftp );
?>
                    
If the maximum limit of FTP users has not been met then the output of the code is :
yep
but if the limit has been exceeded the PHP created warning message is sent without my control.  I believe the function ftp_login should produce the proper false value and nothing else.


Kevin
kevfinn@epitaph.com

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-08-05 00:55 UTC] sniper@php.net
From php-manual, ftp_login: 

int ftp_login (int ftp_stream, string username, string password)

                     Returns true on success, false on error.

                     Logs in the given FTP stream.

Use @ftp_login and the error message disappears magically! =)
Or change php.ini directives for error displaying. 

Please read the friendly manual next time before submitting bug report.

--Jani
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Jun 14 03:01:32 2024 UTC