|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2005-08-04 15:09 UTC] zxc at zmail dot ru
Description:
------------
I have a WARNING message from ftp_login(), but I use a "@" with ftp_login() function.
Function ftp_login() in this case must returns boolean FALSE only without WARNING.
Reproduce code:
---------------
<?
$ftp=ftp_connect("myFTPserver");
@ftp_login("login","password");
if($ftp)
ftp_close($ftp);
?>
Expected result:
----------------
I have a WARNING message from ftp_login(), but I use a "@" with ftp_login() function.
Function ftp_login() in this case must returns boolean FALSE only without WARNING.
Actual result:
--------------
empty screen
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Nov 24 09:00:02 2025 UTC |
sniper, I use 3 parameters: <? $ftp=ftp_connect("myFTPserver"); @ftp_login($ftp,"login","password"); if($ftp) ftp_close($ftp); ?> I have WARNING message (from "ftp_login()" function) if remote FTP server is FULL (many users etc.) But I must have boolean FALSE only from ftp_login() function in this case (without WARNING message), because I use prefix "@" before "ftp_login()".Hi, Tony. Hi, Sniper. I has understood what was it: -- Example #1: <? $ftp=ftp_connect("remoteFtpServer.domain"); // I using not existing account to connect. var_dump(ftp_login($ftp,"unknown","user")); ?> Actual result is: bool(false) with WARNING message (WARNING: ftp_login(): Not logged in, user or password incorrect!). It's right. -- Example #2: <? $ftp=ftp_connect("remoteFtpServer.domain"); // I using not existing account to connect. var_dump(@ftp_login($ftp,"unknown","user")); ?> Actual result is: bool(false) WITHOUT WARNING message (WARNING: ftp_login(): Not logged in, user or password incorrect!), but I use a "@" before ftp_login() function. It's right. -- Example #3: <? function errHandler($errNum,$errStr,$errFile,$errLine) { } set_error_handler("errHandler"); $ftp=ftp_connect("remoteFtpServer.domain"); // I using not existing account to connect. var_dump(@ftp_login($ftp,"unknown","user")); ?> Actual result is: bool(false) WITHOUT WARNING message (WARNING: ftp_login(): Not logged in, user or password incorrect!), but I use a "@" before ftp_login() function and in errHandler() function I did not define string fot E_WARNING level. It's right. -- Example #3: <? function errHandler($errNum,$errStr,$errFile,$errLine) { switch($errNum) { case E_WARNING: echo "Warning: ...place for original WARNING message..."; break; } } set_error_handler("errHandler"); $ftp=ftp_connect("remoteFtpServer.domain"); // I using not existing account to connect. var_dump(@ftp_login($ftp,"unknown","user")); ?> Actual result is: bool(false) > WITH WARNING < message (WARNING: ftp_login(): Not logged in, user or password incorrect!) from errHandler() ftunction, but I use a "@" before ftp_login() function and in errHandler() function I did define string fot E_WARNING level. It's wrong. But I read manual strings: "It is important to remember that the standard PHP error handler is completely bypassed. error_reporting() settings will have no effect and your error handler will be called regardless - however you are still able to read the current value of error_reporting and act appropriately. Of particular note is that this value will be 0 if the statement that caused the error was prepended by the @ error-control operator." And now I think It's maybe right.