Welcome Guest, Not a member yet? Register   Sign In
Validation problems
#1

[eluser]Philip Pryce[/eluser]
Well in this thread i just want to ask if i was trying to get a user to return to a form after validating their input wrong, if i just referenced the page function instead of just re-writing it again, is this technically the right way to do it?
For example, say i have these two functions in a Controller called User
Code:
function signin ($error=false, $errormsg='') {
  if ($error == true) {
    echo $errormsg;
  }
  ... lots more code to display sign in form etc
}
function proccessSignIn () {
  ... validation rules etc
  if ($this->validation->run()
    $this->signin(true, $this->validation->error_string);
    die()
  }
  ... more code if the user did meet the validation rules to sign them in
}
sorry for no tab indentations, i wrote this off the top of my head.
Thanks.


Messages In This Thread
Validation problems - by El Forum - 03-25-2008, 07:10 PM
Validation problems - by El Forum - 03-26-2008, 03:28 AM



Theme © iAndrew 2016 - Forum software by © MyBB