• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
validation dont't show message

#11
[eluser]cindor[/eluser]
[quote author="kiyo" date="1243589529"]thank you very much
I write code from guideline

new screenshot << validate error don't show mesage

I change a little in controller/register.php
Code:
class Register Extends Controller{
        function _construct() { // for php5

        $this->load->library('form_validation');
        $this->load->helper('form');

    }
        
        function index(){
            $data["head"] = "register new user";
            $data["title"] = "form register new user";
            $data["meta"] = "register form ";
            $this->load->view("register_view",$data);
        }
        
        function register_process(){
           $data["head"] = "register new user";
            $data["title"] = "form register error";
            $data["meta"] = "register form ";
            $this->form_validation->set_rules("username","username","required|min_length[5]");
            

            
            if($this->form_validation->run() == false){
                
                $this->load->view("register_view",$data);
            }else{
                
                echo "complete";
            }
        }
}

and this is a view/register_process.php
Code:
&lt;?php echo var_dump(validation_errors()); ?&gt; //try to dump data but it empty ,why?

&lt;?=form_open("register/register_process")?&gt;

<table width="360" border="0" cellspacing="0" cellpadding="1">
  <tr>
    <td width="179"><div align="right">username</div></td>
    <td width="177">&lt;input name="username" type="text" id="username" value ="&lt;?=set_value("username","1")?&gt;"/&gt;&lt;/td>
  </tr>

  <tr>
    <td>&lt;input type="submit" name="Submit" value="Submit" /&gt;&lt;/td>
    <td>&nbsp;</td>
  </tr>
</table>
&lt;?=form_close()?&gt;
[/quote]

i guess you are mixing views... in the controller "register_view" is loaded, but you show "register_process" view.

#12
[eluser]kiyo[/eluser]
Thank for all reply

I know one thing The code isn't error. because

I try to test anothor computer it work!!! , WHY???

..focus on my computer

I reinstall apache+php again and again but it doesn't work. (default php.ini it still doen't work)


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.