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 ');