I have in the POST method stored data that I need to pass through the form.

<form id="slick-login" method="post"> <label for="username">Логин:</label><input type="text" name="username" class="placeholder" placeholder="Логин"> <label for="password">Пароль:</label><input type="password" name="password" class="placeholder" placeholder="Пароль"> <input type="submit" name="submit" value="ВОЙТИ" > <input type="button" value="РЕГИСТРАЦИЯ" onClick="window.location='RegPage.php'"> <script src="//ulogin.ru/js/ulogin.js"></script> <div id="uLogin" data-ulogin="display=panel;theme=classic;fields=first_name,last_name;providers=vkontakte,twitter,facebook;hidden=;redirect_uri=http%3A%2F%2F;mobilebuttons=0;"></div> </form> $login = $_POST['username']; $password = $_POST['password']; $query= mysqli_query($connect, "SELECT * FROM Users WHERE login='$login'") or die(mysqli_error($connect)); $user_data= mysqli_fetch_array($query); if($user_data['password']==$password) { header("Location: AddPage.php"); } 

How to use the data in the Post page AddPagge.php

  • if you do it like in the code in question, then only through the header("Location: AddPage.php?data=666&data2=валправполр"); or through the session - Alexey Shimansky
  • @ Alexey Shimansky trying to solve with the session. I opened it and performed the initialization. (Session_start (); $ _SESSION ['Login'] = $ login, but in my second page the value is zero, what am I doing wrong?) - Pavel Kushnerevich
  • @ Alexey Shimansky is there anything to do with the session in the second page? - Pavel Kushnerevich
  • one
    Well, in theory, too, session_start is needed there. - Alexey Shimansky

0