f (isset ($ _ POST ['gebruiker'])) {} не работает - PullRequest
0 голосов
/ 28 апреля 2020

Привет всем. Я пытаюсь отследить формы регистрации и регистрации, показанные ниже, с помощью менеджера тегов Google. Я хочу добавить скрипт datalayer.pu sh при отправке формы. Однако по какой-то причине функция if (isset ($ _ POST)) здесь не работает. Он не регистрируется при отправке формы. Я проверяю его на форме с классом "seeker-register do-registration-form" и отправляю имя кнопки "gebruiker". Этот файл из плагина, который поставляется с темой WordPress. Может ли кто-нибудь помочь мне с этим?

<form action="#" method="post" class="seeker-register do-registration-form">
                                    <div class="form-group">
                                        <div class="tg-registeras">
                                            <span><?php esc_html_e('Already have an account? Please login', 'listingo_core'); ?></span>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <input type="text" name="register[username]" class="form-control" placeholder="<?php esc_html_e('User Name, eg alex', 'listingo_core'); ?>">
                                    </div>
                                    <?php if( apply_filters('listingo_dev_manage_fields','true','user_nicename') === 'true' ){?>
                                    <div class="form-group">
                                        <input type="text" name="register[user_nicename]" class="form-control" placeholder="<?php esc_html_e('Nicename eg : alex', 'listingo_core'); ?>">
                                        <?php do_action('listingo_get_tooltip','element','nicename');?>
                                    </div>
                                    <?php }?>
                                    <?php if( apply_filters('listingo_dev_manage_fields','true','first_name') === 'true' ){?>
                                        <div class="form-group">
                                            <input type="text" name="register[first_name]" class="form-control" placeholder="<?php esc_html_e('First Name', 'listingo_core'); ?>">
                                        </div>
                                    <?php }?>
                                    <?php if( apply_filters('listingo_dev_manage_fields','true','last_name') === 'true' ){?>
                                        <div class="form-group">
                                            <input type="text" name="register[last_name]" class="form-control" placeholder="<?php esc_html_e('Last Name', 'listingo_core'); ?>">
                                        </div>
                                    <?php }?>
                                    <?php if( apply_filters('listingo_dev_manage_fields','true','gender') === 'true' ){?>
                                        <div class="form-group">
                                            <span class="tg-select">
                                                <select name="register[gender]">
                                                    <option value=""><?php esc_html_e('Gender', 'listingo_core'); ?></option>
                                                    <option value="male"><?php esc_html_e('Male', 'listingo_core'); ?></option>
                                                    <option value="female"><?php esc_html_e('Female', 'listingo_core'); ?></option>
                                                </select>
                                            </span>
                                        </div>
                                    <?php }?>
                                    <?php if( apply_filters('listingo_dev_manage_fields','true','phone') === 'true' ){?>
                                        <div class="form-group">
                                            <input type="text" name="register[phone]" class="form-control" placeholder="<?php esc_html_e('Phone', 'listingo_core'); ?>">
                                            <?php do_action('listingo_get_tooltip','element','phone');?>
                                        </div>
                                    <?php }?>
                                    <div class="form-group">
                                        <input type="email" name="register[email]" class="form-control" placeholder="<?php esc_html_e('Email', 'listingo_core'); ?>">
                                    </div>
                                    <div class="form-group">
                                        <input type="password" name="register[password]" class="form-control" placeholder="<?php esc_html_e('Password', 'listingo_core'); ?>">
                                    </div>
                                    <div class="form-group">
                                        <input type="password" name="register[confirm_password]" class="form-control" placeholder="<?php esc_html_e('Retype Password', 'listingo_core'); ?>">
                                    </div>
                                    <?php do_action('listingo_registration_customer_extra_fields');?> 
                                    <div class="form-group term-group">
                                        <?php 
                                        if( isset( $captcha_settings ) 
                                                && $captcha_settings === 'enable' 
                                            ) {
                                        ?>
                                            <div class="domain-captcha">
                                                <div id="recaptcha_signup"></div>
                                            </div>
                                        <?php }?>
                                        <div class="tg-checkbox">
                                            <input name="terms"  type="hidden" value="0"  />
                                            <input name="terms" type="checkbox" id="terms">
                                            <label for="terms">
                                                <?php if (!empty($terms_link)) { ?>
                                                    <?php esc_html_e('I have read the', 'listingo_core'); ?>&nbsp;<a target="_blank" href="<?php echo esc_url($terms_link); ?>"><?php esc_html_e('Terms & Conditions', 'listingo_core'); ?></a>&nbsp;<?php esc_html_e('and accept them', 'listingo_core'); ?>
                                                <?php } else { ?>
                                                    <?php esc_html_e('I agree with the terms and conditions and accept them', 'listingo_core'); ?>
                                                <?php } ?>

                                            </label>

                                            <input type="hidden" name="register[account]" value="seeker">
                                            <?php wp_nonce_field('register_seeker_request', 'register_seeker_request'); ?>
                                            <input class="tg-btn do-regiter-me" type="submit" value="Meld je aan" name="gebruiker">
                                        </div>
                                    </div>
                                </form>
<?php
if(isset($_POST['gebruiker'])){
    echo "<script type='text/javascript'>alert('yesss');</script>";
}
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...