Advertisement
Guest User

Untitled

a guest
May 21st, 2019
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.95 KB | None | 0 0
  1. <?php session_start();
  2. include 'functions.php';
  3. ?>
  4.  
  5.  
  6.     <form action="register.php" method="post">
  7.         <input type="text" name="login">
  8.         <input type="password" name="password">
  9.         <button>Регистрация</button>
  10.     </form>
  11. <?php
  12.     if(!isset($_SESSION['status'])) {
  13.             echo '<p>Авторизация:</p>
  14.                <form action="login.php" method="post">
  15.             <input type="text" name="login">
  16.             <input type="password" name="password">
  17.             <button>Войти</button>
  18.                </form>';
  19.         }
  20.  
  21.     if(isset($_SESSION['login'])) {
  22.         echo 'Привет ' . $_SESSION['login'];
  23.     }
  24.  
  25.     if(isset($_SESSION['status'])) {
  26.             echo '<form enctype="multipart/form-data" action="upload.php" method="post">
  27.                <input type="file" name="file">
  28.                <button>Загрузить фото</button>
  29.                </form>';
  30.         }
  31. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement