更新时间:2022-12-07 10:01:03
config / routes.php
$route['login/check'] = 'auth/my_front_end_login';
查看
<?php echo form_open('login/check'); ?>
<fieldset>
<legend>login Credentials<legend>
<label for="identity">∗ Identity</label>
<input type="text" name="identity" id="identity" value="<?php echo set_value('identity');?>" />
<?php echo form_error('identity');?>
<label for="password">∗ Password</label>
<input type="password" name="password" id="password" value="<?php echo set_value('password');?>" />
<?php echo form_error('password');?>
<label for="message">∗ Message</label>
<input type="text" name="message" id="message" value="<?php echo set_value('message');?>" />
<?php echo form_error('message');?>
</fieldset>
<?php echo form_close();?>
controllers / auth
public function my_front_end_login(){
if($this->form_validation->run('login_frontend')) // uses config/form_validation.php
{
//validation passed, now attempt login via ION_AUTH
//open ION_Auth library file and see what the login method requests in its params.
if(ION_Auth::login($params)) // Im not familiar with it
{
//login success
}
else
{
//login failure
}
}
else
{
$this->index();
}
}