TP is automatically fulfilled. does TP not work for non-Create statements?

Source: Internet
Author: User
TP automatic verification, does not work for non-Create? & Nbsp; public & nbsp; function & nbsp; register () {& nbsp; & nbsp; if ($ this TP automatic verification does not work for non-Create instances?
Public function register (){
If ($ this-> isPost ()){
$ Mem = D ('member ');
If ($ Mem-> Create ()){
If ($ Mem-> add ())
Echo $ Mem-> getLastSql ();
$ This-> assign ('waitsecond', 3 );
$ This-> success ("registered successfully", "_ APP _/Member/login ");}

The above code can be verified.


Public function xinxixiugai (){
If ($ this-> isPost ())
{
$ Model = D ('member ');
$ Password = $ _ POST ['password'];
$ Tel = $ _ POST ['tel'];
$ Address = $ _ POST ['address'];

If ($ Model-> Update ($ password, $ tel, $ address ))
{$ This-> success ("updated successfully" ,__ APP _/Space/index );}
Else
Echo $ Model-> getError ();
}

This cannot be verified...
In addition, if I read the manual and use create for modification, do I need to add an ID hidden field in the form?
Is it possible to add PHP code, session ('id'), and hidden domain to the page?
------ Solution --------------------
Automatic verification seems to apply only to create
------ Solution --------------------
It is described in this document that the verification is not manually called by create:

Manual verification

In the new version, a check method is added for manual data verification when required. some automatic verification rules are supported. the usage is as follows:

Check ('verification data', 'verification rule', 'verification type ')

The verification type supports in between equal length regex expire ip_allow ip_deny. the default value is regex, and a Boolean value $ model-> check ($ value, 'Email ') is returned '); $ model-> check ($ value, '1, 2, 3 ', 'in ');

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.