PHP : Function Reference : Mcrypt Encryption Functions : mcrypt_generic_init
cnww
If you write error-checking into your code, be warned that this function returns FALSE on some errors, and 0 on success, hence
mcrypt_generic_init( $a, $b, $c ) or die( "Oops");
ALWAYS exits with the error message "Oops", and
(mcrypt_generic_init( $a, $b, $c ) >= 0 ) or die( "Oops");
Sometimes continues when mcrypt_generic_init() actually failed.
To check for successful init use something like:
$s = mcrypt_generic_init( $a, $b, $c );
if( ($s < 0) || ($s === false))
die( "Really an error" );
|