ini_set('error_reporting',E_ALL); ini_set('display_errors', 1);
_ym_debug=1
к вашему запросу, и проверьте срабатывание цели в консоле (подробнее) public function isSpambots($mail,$ip){
$spambot = false;
//check the e-mail adress
$xml_string = file_get_contents('http://www.stopforumspam.com/api?email='.$mail);
$xml = new SimpleXMLElement($xml_string);
if($xml->appears == 'yes'){
$spambot = true;
}elseif($spambot != true){
//e-mail not found in the database, now check the ip
$xml_string = file_get_contents('http://www.stopforumspam.com/api?ip='.$ip);
$xml = new SimpleXMLElement($xml_string);
if($xml->appears == 'yes'){
$spambot = true;
}
}
return $spambot;
}
$cmsController = cmsController::getInstance();
$moduleUs = $cmsController->getModule("users");
if($moduleUs->isSpambots($_REQUEST['data']['new']['email'], $_SERVER['REMOTE_ADDR'])){
$this->errorNewMessage("Подазрение на спам");
$this->errorPanic();
return false;
}
if($_SERVER['REMOTE_ADDR'] == '127.0.0.1') {
defined('YII_DEBUG') or define('YII_DEBUG', true);
defined('YII_ENV') or define('YII_ENV', 'dev');
}
// comment out the following two lines when deployed to production
defined('YII_DEBUG') or define('YII_DEBUG', true);
defined('YII_ENV') or define('YII_ENV', 'dev');
use libphonenumber\PhoneNumberUtil;
use libphonenumber\NumberParseException;
public function validatePhone($phone, $country): bool
{
$phoneUtil = PhoneNumberUtil::getInstance();
try {
$phoneNumber = $phoneUtil->parse($phone, strtoupper($country));
return $phoneUtil->isValidNumber($phoneNumber);
} catch (NumberParseException $e) {
return false;
}
}
import { parsePhoneNumberFromString } from 'libphonenumber-js';
$("#phoneinput").on('countrychange', function () {
const country = window.iti.getSelectedCountryData().iso2.toUpperCase();
const phone = $("#phoneinput").val();
const phoneNumber = parsePhoneNumberFromString(phone, country);
if (phoneNumber && phoneNumber.isValid()) {
// Номер телефона валиден
} else {
// Номер телефона не валиден
}
});