I wrote a PHP verification code class myself. Later, when debugging, I found that when the PHP file that generated the verification code image was called separately, the verification code on the picture always did not match the actual verification code string; however, when that file was There is no such problem when embedded into html. Everything is normal, which is very strange.
I haven’t figured out what the problem is after researching it for a long time. I’m very confused. Then I downloaded several PHP verification code classes written by other people online. I basically have this problem. It took me a long time to think about it, so I think it’s still the problem. Let it go for now.
In addition, when calling the php file on the page, I found that reading the session value of the verification code on this page is always a beat slower. The reason is that the method of introducing files such as require_once seems to be asynchronous, not the synchronization I take for granted. This resulted in results that were inconsistent with one's own ideas. Well, I encountered these two problems this morning.
The above has introduced that the separate call of the PHP verification code generated file does not match the actual string, including the verification code and string content. I hope it will be helpful to friends who are interested in PHP tutorials.