When writing the php verification code page, I stored the php file on the Sina cloud server and thought about using ajax request session to verify the verification code on the javascript page. I think this method should be feasible, however, in actual operations, it is found that the session obtained using ajax is always empty ,... before writing
Php verification code
When the page is accessed, the php file is stored on the Sina cloud server.
javascript
Use ajax requests on the page
session
To verify the verification code, I feel that this method should be feasible, but in actual operation, it is found that
ajax
Obtained
session
It has been blank and has not been requested. one is wrong code, meditation, various queries, and finally found that netizens said Sina Cloud could not save
session
But I use
form
You can get
session
Value. why...
Reply content:
Before writingPhp verification code
When the page is accessed, the php file is stored on the Sina cloud server.javascript
Use ajax requests on the pagesession
To verify the verification code, I feel that this method should be feasible, but in actual operation, it is found thatajax
Obtainedsession
It has been blank and has not been requested. one is wrong code, meditation, various queries, and finally found that netizens said Sina Cloud could not savesession
But I useform
You can getsession
Value. why...
If the framework is not used, session_start () must be at the beginning of the PHP file, and $ _ SESSION will be used in the file for the function.