CodeIgniter Forums
form validation help - Printable Version

+- CodeIgniter Forums (
+-- Forum: Archived Discussions (
+--- Forum: Archived General Discussion (
+--- Thread: form validation help (/thread-26168.html)

form validation help - El Forum - 01-07-2010

I'm going through the users guide tutorial over form validation but i wanted to add my own form validation. First of all, does the form validation code go inside the controller? second what am i doing wrong here? I just want to check to see if the username of the field was entered as Bob...if not reload the page, if so go to google. Heres my controller script

class Form extends Controller {

    function index()
        $data['title'] = "My Form Title";
        $data['heading'] = "My Form Heading";

        if($_POST['usernmae'] !== "Bob")
        $this->load->view('form_view', $data);


form validation help - El Forum - 01-07-2010

yes the form validation code goes inside the controller
and don't use $_POST it isn't very secure

form validation help - El Forum - 01-07-2010

This is not an example of form validation, you can do this without the library.