daily pastebin goal
2%
SHARE
TWEET

Untitled

a guest Oct 3rd, 2017 64 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php session_start()?>
  2.     <!DOCTYPE html>
  3.     <html lang="en">
  4.     <head>
  5.         <!-- Required meta tags -->
  6.         <meta charset="utf-8">
  7.         <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
  8.  
  9.         <!-- Bootstrap CSS -->
  10.         <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta/css/bootstrap.min.css" integrity="sha384-/Y6pD6FV/Vv2HJnA6t+vslU6fwYXjCFtcEpHbNJ0lyAFsXTsjBbfaDjzALeQsN6M" crossorigin="anonymous">
  11.     </head>
  12.     <body>
  13.  
  14.     <!-- Optional JavaScript -->
  15.     <!-- jQuery first, then Popper.js, then Bootstrap JS -->
  16.     <script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
  17.     <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.11.0/umd/popper.min.js" integrity="sha384-b/U6ypiBEHpOf/4+1nzFpr53nxSS+GLCkfwBdFNTxtclqqenISfwAzpKaMNFNmj4" crossorigin="anonymous"></script>
  18.     <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta/js/bootstrap.min.js" integrity="sha384-h0AbiXch4ZDo7tp9hKZ4TsHbi047NrKGLO3SEJAg45jXxnGIfYzk4Si90RDIqNm1" crossorigin="anonymous"></script>
  19.  
  20. <?php
  21. /**
  22.  * Created by PhpStorm.
  23.  * User: jk
  24.  * Date: 03.10.2017
  25.  * Time: 21:05
  26.  */
  27. require_once "operationDb.php";
  28.  
  29. $conn = new operationDb();
  30.  
  31.  
  32. if($_SESSION['login']){
  33.     echo" Aktualnie jesteś zalogowany jako ".$_SESSION['login']."
  34. <div class=\"container\">
  35.    <div class=\"row\">
  36.        <form method=\"POST\">
  37.          
  38.  
  39.            <input type=\"submit\" name=\"logout\" class=\"btn btn-primary\" value=\"Wyloguj\" />
  40.        </form>
  41.    </div>
  42. </div>";
  43.     } else echo "
  44.  
  45.  
  46. <div class=\"container\">
  47.    <div class=\"row\">
  48.        <form method=\"POST\">
  49.            <label for=\"exampleInputEmail\">Twój login</label>
  50.            <input class=\"form-control\" type=\"text\" placeholder=\"Default input\" name=\"name\">
  51.            <div class=\"form-group\">
  52.                <label for=\"exampleInputEmail\">Adres mailowy</label>
  53.                <input type=\"email\" class=\"form-control\" id=\"exampleInputEmail1\" aria-describedby=\"emailHelp\" placeholder=\"Enter email\" name=\"email\">
  54.                <small id=\"emailHelp\" class=\"form-text text-muted\">We'll never share your email with anyone else.</small>
  55.            </div>
  56.            <div class=\"form-group\">
  57.                <label for=\"exampleInputPassword1\">Hasło</label>
  58.                <input type=\"password\" class=\"form-control\" id=\"exampleInputPassword1\" placeholder=\"Password\" name=\"pass\">
  59.            </div>
  60.  
  61.            <input type=\"submit\" name=\"register\" class=\"btn btn-primary\" value=\"Zarejestruj\" />
  62.  
  63.        </form>
  64.    </div>
  65. </div>
  66.  
  67. ";
  68. $email = $_POST['email'];
  69. $pass = $_POST['pass'];
  70. $name = $_POST['name'];
  71.  
  72. echo $pass.$email.$name;
  73.  
  74. if(isset($_POST['logout'])){
  75.     unset($_SESSION['user_id']);
  76.     unset($_SESSION['login']);
  77. }
  78.  
  79. if(isset($_POST['register'])){
  80.    $conn->addUser($name, $email, $pass);
  81. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top