Max,
I'm trying to do the server side validation for an email. I'm using the following code in the server side validation code box but it doesn't seem to work.
<?php
$ref_num = JRequest::getVar('text_4', '', 'post');
$db =& JFactory::getDBO();
$query = "
SELECT count(*)
FROM `#__users`
WHERE `ref_num` = ".$db->Quote($quote)." ;
";
$db->setQuery($query);
$in_use = $db->loadResult();
if ( $in_use) {
return "That email is already registered, please try again";
}
?>
I'm trying to do the server side validation for an email. I'm using the following code in the server side validation code box but it doesn't seem to work.
<?php
$ref_num = JRequest::getVar('text_4', '', 'post');
$db =& JFactory::getDBO();
$query = "
SELECT count(*)
FROM `#__users`
WHERE `ref_num` = ".$db->Quote($quote)." ;
";
$db->setQuery($query);
$in_use = $db->loadResult();
if ( $in_use) {
return "That email is already registered, please try again";
}
?>