[eluser]jahDsign[/eluser]
Hi everyone,
I have been stuck for some time on this problem and cannot really find a solution anywhere, so I have decided to go ahead and post it on this forum.
I am using the validate plugin from Jquery for a user registration and came across this problem:
here is an extract of my code -
model:
Code:
function check_exist_($Uemail)
{
$query_str = 'SELECT Uemail FROM users WHERE Uemail = ?';
$result = $this->db->query($query_str, $Uemail);
//email exists
if($result->num_rows() > 0)
//email is not unique
return false;
else
//email is unique
return true;
}
controller:
Code:
function JQ_unique_Uemail()
{
$Uemail = $this->input->post('register_Uemail');
if($this->User_model->check_exist_($Uemail))
echo 'true';
else
echo 'false';
}
view:
Code:
<input id="register_Uemail" type="text" name="register_Uemail" value="<?php echo set_value('register_Uemail'); ?>" class="required email" />
$('#registerForm').validate({rules:{register_UconfirmPassword:{equalTo: '#register_Upassword'},register_Uemail:{remote:{url:"<?php echo $base_url.'pages/JQ_unique_Uemail'; ?>",type:'POST'}}},
messages:{register_UconfirmPassword:{equalTo:'The passwords you have entered do not match.'},register_Uemail:{remote:'This email is already registered.'}}});
please note I have stripped out all unrelated information to my probelm...
So, the odd thing is when I view my page on my local server, it works perfectly: if the email is not registered in the DB, it is all good, and if the email is already registered, it shows up the error message dynamically.
Now, when I upload this code to my production server, it keeps coming up with the error message on Firefox, but in IE it actually crashes the javascript when I type anything on that input.
I have looked at the net stream in Firefox with Firebug, and when I type something in the email input, net stream shows the function being called (mysite/index.php/pages/JQ_unique_Uemail) but the status says "500 Internal Server Error"...
No idea where that could be comming from!
Has anyone ever come across this before?
Thank you very much,
Antoine.