I also asked a question about the verification code generated by php. The final result is that the last string is stored in the session and exists on the server side. what if the verification code exists on the client side, whether javascript can be used to load the verification code should be & lt; imgsrc & quot; aaa. php & quot; & gt; aaa. php is a file that generates images. It seems that echo & lt; script & gt; document. g also asks a verification code question.
Php code generation
In the final analysis, the last string is stored in the session,
On the server side,
If the verification code is stored on the client,
Can I use javascript for operations?
Load the verification code
Aaa. php is a file that generates images.
It seems that echo 'script document. getElementById... script '; does not seem to work ..
Who has new ideas?
------ Solution --------------------
If you pass the verification code value to the client, won't the user get it easily?
------ Solution --------------------
What do you want the verification code?
------ Solution --------------------
Then you can simply write a verification code using JS to relieve the pressure on the server...
------ Solution --------------------
If you do that, the verification code does not work.
------ Solution --------------------
Discussion
What do you want the verification code?
------ Solution --------------------
The verification code is used to prevent brute-force robot cracking.
If you pass the verification code value to the client, the robot can easily obtain it. In this case, isn't your verification code an empty one?
------ Solution --------------------
Your php has output the verification code. is it still called the client? Besides, you can only add a token in this way. we often do this. this is not a verification code.