I am trying to make a match check on the phone in the joomshop component, I just don’t understand how to get the variable to be checked. The function that checks if such user exists:
function check_user_exist_ajax() { $mes = array(); $username = JRequest::getVar("username"); $email = JRequest::getVar("email"); $mobil_phone = JRequest::getVar("mobil_phone"); $db = JFactory::getDBO(); /* $mes[] = sprintf(_JSHOP_USER_EXIST_EMAIL, $mobil_phone); */ if (isset($mobil_phone)){ $query = "SELECT id FROM `#__jshopping_users` WHERE mobil_phone = '".$mobil_phone."'"; $db->setQuery($query); $db->query(); if ($db->getNumRows()){ $mes[] = sprintf(_JSHOP_USER_EXIST_EMAIL, $mobil_phone); } } if ($username){ $query = "SELECT id FROM `#__users` WHERE username = '".$db->escape($username)."'"; $db->setQuery($query); $db->query(); if ($db->getNumRows()){ $mes[] = sprintf(_JSHOP_USER_EXIST, $username); } } if ($email){ $query = "SELECT id FROM `#__users` WHERE email = '".$db->escape($email). "'"; $db->setQuery($query); $db->query(); if ($db->getNumRows()){ $mes[] = sprintf(_JSHOP_USER_EXIST_EMAIL, $email); } } if (count($mes)==0){ print "1"; }else{ print implode("\n",$mes); } die(); } I can not get a phone number $ mobil_phone = JRequest :: getVar ("mobil_phone"); Returns an empty field. Explain how JRequest :: getVar gets data