Let me see where the error is and how the input error is displayed.
03. php
Session_start ();
Function a ($ type, $ length, $ clear ){
$ Nums = range (0, 9 );
$ Xxzm = range ('A', 'z ');
$ Dxzm = range ('A', 'z ');
$ Igorne = array ('0', 'O', '1', 'L ');
$ Chars = array ();
If ($ type = 1)
$ Chars = $ nums;
If ($ type = 2)
$ Chars = array_merge ($ nums, $ xxzm );
If ($ type = 3)
$ Chars = array_merge ($ nums, $ xxzm, $ dxzm );
If ($ clear = true)
$ Chars = array_diff ($ chars, $ igorne );
$ Keys = array_rand ($ chars, $ length );
$ Code = "";
Foreach ($ keys as $ key)
$ Code = $ code. $ chars [$ key];
Return $ code;
}
$ Yzm = a (3,5, true );
$ _ SESSION ['yzm'] = $ yzm;
Echo $ yzm;
?>
Reply to discussion (solution)
You can print $ _ SESSION ['yzm'] and $ _ POST ['check'] at the beginning of the program file and the code segment that receives and submits it. then you will know the problem.
Require ('03. php'); // Generate a verification code and save it to $ _ SESSION
$ Checkstr = $ _ SESSION ['yzm']; // use the $ _ SESSION variable to obtain the verification code on the EX4_14_image.php page.
Always run later. Obviously, only the latest settings are obtained.
How can we change it?