Thinkphp inserts data. Amazing problem.

Source: Internet
Author: User
Thinkphp inserts data. Amazing problem. It has been so long for the program. This problem occurs for the first time. Very speechless... There is no solution ..

Test. php? A = index & ac = adduser & uid = 399
This address uses THINKPHP. The code is roughly as follows:
$ LinkUser = D ('linkuser ');
$ Data = array ();
$ Data ['nickname'] = 'test ';
$ Newid = $ LinkUser-> add ($ data );
It can be added normally, but the data will be repeated and the re-execution will not be repeated.

If the parameter is set to 400
Test. php? When a = index & ac = adduser & uid = 400, insert. We found two retries.

As long as the address bar parameter value changes. It will be inserted repeatedly. It is normal if no change is made. I am puzzled...

Seek help again. Thank you!


Reply to discussion (solution)

Is there a front-end for this link? does the front-end request the same url? it looks normal when I refresh it again because there is only one url to access the cache?
Is the add method in your LinkUserModel redefined to secretly receive uid?

Front-end address:
Http://www.dooraa.com/test.php? A = index & uid = 1
Click Add directly. Then click on the original connection. It will not be repeated. Next, add a new connection point. Will be repeated. Click it again.

The LinkUserModel class is actually empty ..

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.