Welcome Guest, Not a member yet? Register   Sign In
n00b asking about CI validation feature
#1

[eluser]Unknown[/eluser]
hi all,

i have problem with validation library

i do this simple example for education purpose, but i can't make it run correctly

why not working?

Code:
<html>
<head>
</head>
<body>
<?=$this->validation->error_string?>
<?=form_open('myform')?>
<?=form_input('testing')?>
<?=form_button('submit', 'submit')?>
<?=form_close() ?>
</body>
</html>

Code:
<?php
class myform extends Controller {
    public function index(){
        $this->load->helper(array('form', 'url'));
        $this->load->library('validation');
        $this->load->view('form');

        $rules['testing'] = 'required';
        $this->validation->set_rules($rules);

        if($this->validation->run() == true){
            var_dump($_POST);
        } else {
            echo 'validation not succeed';
        }
    }
}


Messages In This Thread
n00b asking about CI validation feature - by El Forum - 10-22-2008, 12:17 AM
n00b asking about CI validation feature - by El Forum - 10-22-2008, 12:39 AM
n00b asking about CI validation feature - by El Forum - 10-22-2008, 12:45 AM
n00b asking about CI validation feature - by El Forum - 10-22-2008, 12:52 AM



Theme © iAndrew 2016 - Forum software by © MyBB