SESSION and verification code

Source: Internet
Author: User
SESSION and verification code: apache is installed on the server.

The website is developed using the ThinkPHP framework and comes with a verification code image.

The member registration page uses the verification code and the html page:



Code used by the program to determine the verification code image during registration:

If ($ _ SESSION ['verify ']! = Md5 ($ _ POST ['verify '])
Exit ('verification code error! ');

The program should be fine, because it is normal for me to test locally and on the server.

However, someone said that the verification code was entered correctly during registration. The result showed that the verification code was incorrect!

He said it would not work with IE or FF browsers ......

I went up to test that I had registered a new member. others registered members were also successful.

I don't know what's wrong with me?

I doubt the web environment: Is there a problem with apache + php?


Reply to discussion (solution)

Individual cannot

It indicates that the problem is related to the client, or it is all on the client.

Individual cannot

It indicates that the problem is related to the client, or it is all on the client.

Well, this friend registered on another computer, but the verification code was incorrect.

Strange, will it be a network problem on the client side? As a result, the verification code image is different from the actual one.

Add one sentence
If (isset ($ _ SESSION ['verify ']) & $ _ SESSION ['verify']! = NULL & $ _ SESSION ['verify ']! = ''){
// Continue to judge whether the verify value is equal;
} Else {
Echo 'session [verify] value does not exist or is empty, check whether the server's session function is normal ';
}

Add one sentence
If (isset ($ _ SESSION ['verify ']) & $ _ SESSION ['verify']! = NULL & $ _ SESSION ['verify ']! = ''){
// Continue to judge whether the verify value is equal;
} Else {
Echo 'session [verify] value does not exist or is empty, check whether the server's session function is normal ';
}

Well, this method is good. let me try it.

If the SESSION ['verify '] value does not exist or is null, you can determine whether it is a server problem.

His browser settings problems.

Add one sentence
If (isset ($ _ SESSION ['verify ']) & $ _ SESSION ['verify']! = NULL & $ _ SESSION ['verify ']! = ''){
// Continue to judge whether the verify value is equal;
} Else {
Echo 'session [verify] value does not exist or is empty, check whether the server's session function is normal ';
}

Indeed, a friend logged on to the system and asked "the session [verify] value does not exist or is empty. check whether the session function of the server is normal"

Is there a problem with the server?

The server is installed with apache

The website is developed using the ThinkPHP framework and comes with a verification code image.

The member registration page uses the verification code and the html page:



During registration, the program judges the generation of the verification code image ......

The owner can check whether cookies are disabled in browsers that cannot be correctly operated.

The owner can check whether cookies are disabled in browsers that cannot be correctly operated.

I have seen some people say that "cookies and sessions in PHP are not necessarily related"

So what should I do now be a problem with the web environment? If so, I plan to change the environment

Firefox works normally. Other browsers show that the session is not defined,

Related Article

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.