E
E
Evgeniy2020-09-06 22:04:25
WordPress
Evgeniy, 2020-09-06 22:04:25

Why is the login form not working correctly?

Hello, I wrote a custom WordPress login form and put it in the header. The problem is that if I enter the login and password correctly, the page is refreshed, but it does not enter wp. You need to refresh the page itself again and go to the administrative panel. The hidden redirect_to field does not work at all, I tried to change the logic of work, and changed several functions, but nothing helped. I will be glad for any help

<form class="form__sign-in" action="" method="post">
    <div class="form__input">
      <input type="text" placeholder="Логин или e-mail" name="log" id="user_login">
      <div>
        <a data-fancybox="" data-animation-duration="700" href="#forpass">Забыли пароль</a>
        <a data-fancybox="" data-animation-duration="700" href="#registration">Регистрация</a>
      </div>
    </div>
    <div class="form__input">
      <input type="password" placeholder="Пароль" name="pwd" id="user_pass">
      <label><input name="rememberme" type="checkbox" id="rememberme" value="forever" /><span>Запомнить меня</span></label>
    </div>
    <input type="hidden" name="redirect_to" value="<?php echo $_SERVER['HTTP_REFERER']; ?>">
    <input type="hidden" name="testcookie" value="1" />
    <div class="form__input">
      <input type="submit" placeholder="Войти" value="Войти" name="button" class="form__button">
    </div>
    </form>

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Artem Gvozdev, 2020-09-06
@Evdokim001

Where is your php and js handler?
I use this code here, but of course I cost it
https://gist.github.com/cristianstan/10273612

X
xShiroe, 2016-04-16
@xShiroe

if you are still interested write vitalik199211

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question