Welcome Guest, Not a member yet? Register   Sign In
Label in Form Validation
#5

PHP Code:
public function email_agreement()
    {
        
$messages = [
            
'notice_email' => [
                
'required' => 'Email is required',
                
'valid_email' => 'Email is invalid',
            ],
        ];
        
$this->validation->setRules([
            
'notice_email' => 'required|valid_email',
        ], 
$messages);

        if (
$this->request->getPost('submitted') == null || 
                ! 
$this->validation->withRequest($this->request)->run()) {
            print 
view('header', [
                
'current' => 'register'
                
'title' => 'Email Agreement'
                
'session' => $this->session,
            ]);
            print 
view('email_agreement', [
                
'validation' => $this->validation
                
'session' => $this->session,
                
'confirm' => $this->request->getGet('confirm'),
            ]);
            print 
view('footer');
        } else {
            
$this->session->set($this->request->getPost());
            
$confirm $this->request->getPost('confirm');
            if (
$confirm == 'yes')
                
redirect('/register/confirm_input');
            else
                
redirect('/register/subscriber_and_contact_info');
        }
    } 
Simpler is always better
Reply


Messages In This Thread
Label in Form Validation - by Flavio Cesarino - 11-08-2017, 01:05 PM
RE: Label in Form Validation - by InsiteFX - 11-09-2017, 03:37 AM
RE: Label in Form Validation - by Flavio Cesarino - 11-09-2017, 05:31 AM
RE: Label in Form Validation - by Flavio Cesarino - 11-09-2017, 08:52 AM
RE: Label in Form Validation - by donpwinston - 11-09-2017, 11:09 AM
RE: Label in Form Validation - by Flavio Cesarino - 11-09-2017, 01:36 PM
RE: Label in Form Validation - by donpwinston - 11-09-2017, 02:29 PM
RE: Label in Form Validation - by Flavio Cesarino - 11-09-2017, 02:30 PM
RE: Label in Form Validation - by kilishan - 11-09-2017, 02:40 PM
RE: Label in Form Validation - by averroez - 11-15-2017, 12:11 PM



Theme © iAndrew 2016 - Forum software by © MyBB