Sorry.Harro Verton wrote on Saturday 24th of September 2011:That looks very much like Html::anchor(), an anchor is not a form element, and certainly no submit button. And your other question is not a question. What do you want to know?
if(Auth::check())
{
Response::redirect('account');
}
$val =\Fuel\Core\Validation::factory('users');
$val->add_field('username', 'Your username', 'required|min_length[3]|max_length[20]');
$val->add_field('password', 'Your password', 'required|min_length[3]|max_length[20]');
if($val->run())
{
$auth = Auth::instance();
if($auth->login($val->validated('username'),$val->validated('password')))
{
Session::set_flash('notice','FLASH: logged in');
Response::redirect('account');
}else
{
$data['username'] = $val->validated('username');
$data['errors'] = 'Wrong username/password';
}
}else
{
if($_POST)
{
$data['username'] = $val->validated('username');
$data['errors'] = 'Wrong username/password combo. Try again';
}
else
{
$data['errors'] = false;
}
}
$this->template->errors = @$data['errors'];
$this->template->content = \Fuel\Core\View::factory('account/login', $data);
It looks like you're new here. If you want to get involved, click one of these buttons!