I made a custom form for forget password in WP.
below is the code that use:
<form name="lostpasswordform" id="lostpasswordform" action="'.wp_lostpassword_url().'" method="post">
<label for="user_login">Username:<br>
<input name="user_login" id="user_login" class="input" value="" size="" type="text"></label><br><br>
<label for="user_email">E-mail Address:<br>
<input name="user_email" id="user_email" class="input" value="" size="" type="text"></label>
<input type="hidden" name="" id="url_temp" value="'.str_replace( '%7E', '~', $_SERVER['REQUEST_URI']).'&axcelerate=forgotpassword">
<input name="redirect_to" value="&user_login=&user_email=" type="hidden" id="lostpasswordform_addon"><br><br>
<p class="submit">
<input name="wp-submit" id="wp-submit" class="button button-primary button-large" value="Get New Password" type="submit">
</p>
</form>
<script>
jQuery('#lostpasswordform #user_login').blur(function() {
jQuery('#lostpasswordform_addon').val( jQuery('#url_temp').val() + '&user_login=' + jQuery(this).val() + '&user_email=' + jQuery('#lostpasswordform #user_email').val());
});
jQuery('#lostpasswordform #user_email').blur(function() {
jQuery('#lostpasswordform_addon').val( jQuery('#url_temp').val() + '&user_login=' + jQuery('#lostpasswordform #user_login').val() + '&user_email=' + jQuery(this).val());
});
</script>
I have a problem in the email value when I check into redirect_to
the email format is correct eg. nameof@mail.com
but when I try to set up in a function suing this code:
if($_GET['axcelerate'] == 'forgotpassword'){
echo $_GET['user_email'];
}
it returns nameofmail.com
and not nameof@mail.com
?
does anyone have an idea about my case?