此代码正在检查电子邮件验证,我只想验证电话号码而不是电子邮件

时间:2019-05-30 06:54:23

标签: javascript php mysql ajax

无法取消电子邮件验证 装有电子邮件验证功能,我需要电话号码验证功能

问过Google

public function play($wheel) {
        if(!isset($_POST['nonce']) || !isset($_POST['id']) || !isset($_POST['action']) ||
           !isset($_POST['seq']) || !isset($_POST['pseq']) )
            wp_send_json_error(__('Not allowed.',Config_Manager::$slug));

        if(empty($wheel))
            $wheel = Wheel_service::get_wheel($_POST['id']);

        $current_play = Wheel_service::validate_sequence($wheel, $_POST['seq'], $_POST['pseq']);

        if(!is_int($current_play))
            wp_send_json_error(__('Not allowed.',Config_Manager::$slug));

        $segment = Wheel_service::calculate_segment_hit($wheel);
        $winning = $segment->type != 0;
        $wheel->plays_left = 0;
        $is_last = true;

        if(Settings_Manager::get_setting('log') === true)
            Log_Service::log( sprintf('%s turned wheel %d, and landed on segment %d. They %s.%s',
                $_POST['mail'],
                $wheel->id,
                $segment->id,
                $winning? 'won' : 'lost',
                $winning? 'They hit "' . $segment->label . '", with value "'.$segment->value.'"' :''
            ));

        wp_send_json_success(array(
            'segment' => $segment->id,
            'winning' => $winning,
            'title' => $this->get_segment_title($wheel,$segment),
            'text' => $this->get_segment_text($wheel,$segment),
            'value' => $winning ? $segment->value : null,
            'seq' => Wheel_service::get_sequence($wheel,$current_play+1),
            'html' => Html::view($winning ? 'response-done' : ($is_last ? 'response-done' : 'response-lost'), $wheel)
        ));
    }

    **public function add_email_to_list() {
        if(!isset($_POST['nonce']) || !isset($_POST['id']) || !isset($_POST['mail']) ||
            !isset($_POST['seq']) || !isset($_POST['pseq']) )
            wp_send_json_error(__('Not allowed.',Config_Manager::$slug));
        $email = sanitize_email($_POST['mail']);
    //  if (!filter_var($email, FILTER_VALIDATE_EMAIL))
    //      wp_send_json_error(__('Badly formatted email.', Config_Manager::$slug));**

请检出您可以编辑的文件 https://drive.google.com/open?id=1yUisOL5Y_fZyPkOK6oDg7Q0LdvLjknID

如果您已编辑,请在此处评论谢谢

0 个答案:

没有答案