0
I have a question regarding the passage of parameters between the MVC.
I’m developing the e-mail confirmation on a project. After clicking the link to confirm sent by email, the system picks up GET, the encrypted password and "I want to change the 'active' field in the database".
Home of my Controller:
public function index()
{
$this->load->model('confirma_model');
My View:
$h = $_GET['h'];
if (!empty($h)) {
$this->confirma_model->confirma('$h');
}else{
redirect(base_url('/'));
}
At last my Model:
public function confirma($h){
$this->db->where('md5(id)',$h);
$dados['ativo'] = '1';
return $this->db->update('usuario', $dados);
}
Thank you very much!
As suggested by Guilherme Nascimento, I removed the simple quotes of the variable, but it is not working yet.
– LAURO CAUE DA SILVA