Welcome Guest, Not a member yet? Register   Sign In
Trouble while Integrating Query in CI
#11

[eluser]Mizanur Islam Laskar[/eluser]
Can you clear it with an example plz?..Including the model code that I posted already...also plz tell me with code-snippet what exact change I need to perform in my Model, View and Controller files.....thanks again for your quick response
#12

[eluser]Pascal Kriete[/eluser]
I have never the validation plugin so it's troubleshooting as we go along. The problem is that the remote validation is done using GET requests. So the first thing to do is to change the jQuery ajax call in the validation library to use POST. Then you want to change the controller accordingly:

Code:
function confirm_email( )
{
    $email = $this->input->post('email');
    $this->load->model('check_model');
    $valid_email = $this->check_model->check_email($email);
    echo $valid_email;
}

However, as per the documentation it can only receive true or false.

So we need another small change.
Code:
// ....
$this->load->model('check_model');
$valid_email = $this->check_model->check_email($email);
echo ($valid_email == 0) ? 'false' : 'true';

And that should cover most of the problems.




Theme © iAndrew 2016 - Forum software by © MyBB