$ _ SESSION output problems

Source: Internet
Author: User
$ _ Generate a random number of four numbers when generating the verification code for SESSION output, which is placed in the array $ _ SESSION [code]. the verification code Image & lt; img & nbsp; srccode. php & gt;, and then I followed in & lt; img & nbsp; srccode. php & gt; after this code, an echo & nbsp; $ _ SESSION [code] is added, but the displayed and verification code diagram $ _ SESSION output problems
Four random numbers are generated when the verification code is generated, which are placed in the array $ _ SESSION ['code']. the verification code is shown in the image, and I followed the code, an echo $ _ SESSION ['code'] is added. However, the displayed echo $ _ SESSION ['code'] is inconsistent with the verification code image, which is a bit slower than the generated verification code image, that is, the output verification code is the number on the image of the verification code before refreshing.
------ Solution ----------------------
Execution sequence when forms are generated
Echo '';
Echo $ _ SESSION ['code'];

It is executed only when it is loaded into the browser.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.