Welcome Guest, Not a member yet? Register   Sign In
Form validation with file upload
#7

[eluser]fRkSsK[/eluser]
i changed it. but it still doesn't work. it doesn't care photo_check function.

Code:
<?php

    function photo_check()
    {
        if (!isset($_FILES['h_photo'])) {
            $this->form_validation->set_message('photo_check', 'Upps!..');
            return false;
        }
        else {
            return true;
        }
    }
    
    function photo_add()
    {        
        $config = array(
               array('field' => 'h_photo'  ,'label' => 'Hook Photo'  ,'rules' => 'callback_photo_check'),            
            );
        $this->form_validation->set_rules($config);              
        
        if ($this->form_validation->run() == FALSE)
            {
                // bla bla...
            }
            else
            {
                // bla bla...
            }      
    }
?>


Messages In This Thread
Form validation with file upload - by El Forum - 12-09-2009, 03:19 AM
Form validation with file upload - by El Forum - 12-09-2009, 04:06 AM
Form validation with file upload - by El Forum - 12-13-2009, 09:11 PM
Form validation with file upload - by El Forum - 02-07-2010, 06:49 PM
Form validation with file upload - by El Forum - 02-07-2010, 07:18 PM
Form validation with file upload - by El Forum - 02-08-2010, 01:21 AM
Form validation with file upload - by El Forum - 02-08-2010, 03:46 PM
Form validation with file upload - by El Forum - 02-08-2010, 04:16 PM



Theme © iAndrew 2016 - Forum software by © MyBB