I'm starting to use codeigniter, and I have a question.
In the view, I have 2 forms, one for login and one for registration:
<form id="login" method="post">
<legend>Login</legend>
<p><label>email:</label> <input type="email"/></p>
<p><label>senha:</label> <input type="password"/></p>
<p><label>enviar</label> <input type="submit"/></p>
</form>
<form id="cadastro" method="post">
<legend>Cadastro</legend>
<p><label>nome:</label> <input type="text"/></p>
<p><label>email:</label> <input type="email"/></p>
<p><label>senha:</label> <input type="password"/></p>
<p><label>Repita a senha:</label> <input type="password"/></p>
<p><label>enviar</label> <input type="submit"/></p>
</form>
And in the controller, I have both methods, login and register
public function login(){
echo 'chamou login';
}
public function cadastro(){
echo 'chamou cadastro';
}
But I do not know how to call the right methods, that is, login when I fill in the login and registration fields when I fill in the registration fields. Can anyone help me?