Advertisement
Nikita051

Untitled

Aug 16th, 2022
835
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.03 KB | None | 0 0
  1. <?php
  2.     if($_SESSION['auto'] == true){
  3.         echo "okey";
  4.         $adres = "two.php";
  5.         header("Location: $adres");
  6.     };
  7. ?>
  8. <form action = "" method = "GET">
  9.     <input name="login" placeholder="Login"></br>
  10.     <input name="password" placeholder="Password"></br>
  11.     <input type="date" name="date" placeholder="Birthday"></br>
  12.     <input type="email" name="email" placeholder="Email"></br>
  13.     <input type="submit">
  14. </form>
  15. <?php
  16.    
  17.     $host = "localhost";
  18.     $user = "root";
  19.     $pass = "root";
  20.     $name = "test";
  21.     $link = mysqli_connect($host,$user,$pass,$name);
  22.  
  23.     if (!empty($_GET['login']) and !empty($_GET['password'])){
  24.     $login = $_GET['login'];
  25.     $pass = $_GET['password'];
  26.     $email = $_GET['email'];
  27.     $birt = $_GET['date'];
  28.     $today = date('Y-m-d');
  29.     $query = "INSERT INTO users SET login='$login',password='$pass',Email='$email',birthday='$birt',today='$today'";
  30.      $_SESSION['auto'] = true;
  31.     mysqli_query($link,$query);
  32.     }  
  33.     var_dump($_SESSION['auto']);
  34. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement