Support » Fixing WordPress » Need to duplicate a variable during registration

  • I’ve hacked a registration page to pass user information into our e-mail management program at the same time it registers a user for WP. The problem that I have is that the variable for e-mail address I have to use for the other script is “email”. The login/register script (wp_login.php) uses “user_email”.

    My first attempt was to change all instances of “user_email” to “email”, but that was disastrous. So my workaround is a second field in the sign-up called “Confirm Email” that has the proper variable “email”. I really, really, would rather only have the one email field, but can’t seem to figure out a way to do it and still pass on to the other program.

    This is my entire signup form and extra code to do two actions as it is right now and it works, just not the way I want:

    <script type=”text/javascript”>
    function submitTwice(f){
    f.action = ‘<?php echo site_url(‘wp-login.php?action=register’, ‘login_post’) ?>’;
    f.action = ‘’;’ifr2′
    <div style=”visibility:hidden”>
    <iframe name=”ifr1″ width=”20″ height=”20″></iframe>
    <iframe name=”ifr2″ width=”20″ height=”20″></iframe>

    <form name=”registerform” id=”registerform” method=”post”>
    <label><?php _e(‘Username’) ?>
    <input type=”text” name=”user_login” id=”user_login” class=”input” value=”<?php echo esc_attr(stripslashes($user_login)); ?>” size=”20″ tabindex=”10″ /></label>
    <label><?php _e(‘E-mail’) ?>
    <input type=”text” name=”user_email” id=”user_email” class=”input” value=”<?php echo esc_attr(stripslashes($user_email)); ?>” size=”25″ tabindex=”20″ /></label>
    <label><?php _e(‘Confirm E-mail’) ?>
    <input type=”text” name=”email” id=”user_email” class=”input” value=”<?php echo esc_attr(stripslashes($email)); ?>” size=”25″ tabindex=”20″ /></label>
    <p><label>First Name:
    <input autocomplete=”off” name=”firstname” id=”firstname” size=”25″ value=”” type=”text” tabindex=”30″ /></label>
    <p><label>Last Name:
    <input autocomplete=”off” name=”lastname” id=”lastname” size=”25″ value=”” type=”text” tabindex=”31″ /></label>
    <?php do_action(‘register_form’); ?>
    <p id=”reg_passmail”><?php _e(‘A password will be e-mailed to you.’) ?></p>
    <br class=”clear” />
    <input type=”hidden” name=”redirect_to” value=”<?php echo esc_attr( $redirect_to ); ?>” />
    <p class=”submit”><input type=”button” name=”wp-submit” id=”wp-submit” class=”button-primary” onclick=”submitTwice(this.form)” value=”<?php esc_attr_e(‘Register’); ?>” tabindex=”100″ /></p>
    <input type=”hidden” name=”cid” value=”8817de87ca688760f16176626c2d09cd”>
    <input type=’hidden’ name=’grp[]’ value=’508075′>
    <input type=’hidden’ name=’redirect_url’ value=’’>

    Any ideas???


  • The topic ‘Need to duplicate a variable during registration’ is closed to new replies.