Advertisement
isendrak

Login Beispiel

Mar 15th, 2016
16
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.84 KB | None | 0 0
  1. <?php
  2.     if(isset($_POST['form_email']) && isset($_POST['form_passwort'])){
  3.         if(ueberpruefe_login($_POST['form_email'], $_POST['form_passwort'])){
  4.             $login_ok = true;
  5.         }
  6.         else{
  7.             $login_ok = false;
  8.         }
  9.     }
  10.     else{
  11.         $login_ok = null;
  12.     }
  13. ?>
  14. <html>
  15.     <head>
  16.         <title>Login</title>
  17.         <style type="text/css">
  18.             #registrieren{
  19.                 border-radius: 20px;
  20.                 -webkit-transition-duration: 0.4s;
  21.                 -transition-duration: 0.4s;
  22.                 font-size: 0.8em;
  23.                 padding-left: 5px;
  24.                 padding-right: 5px;
  25.                 background-color: #70d080;
  26.                 text-decoration: none;
  27.                 cursor: default;
  28.                 color: #000;
  29.                 border-right: 1px solid gray;
  30.                 border-bottom: 1px solid gray;
  31.                 border-left: 1px solid white;
  32.                 border-top: 1px solid white;
  33.             }
  34.             #registrieren:hover{
  35.                 background-color: #4CAF50;
  36.                 color: white;
  37.             }
  38.             #registrieren:active{
  39.                 border-right: 1px solid white;
  40.                 border-bottom: 1px solid white;
  41.                 border-left: 1px solid gray;
  42.                 border-top: 1px solid gray;
  43.             }
  44.             #loginbox{
  45.                 display: none;
  46.                 position: absolute;
  47.                 left: 5px;
  48.                 top: 5px;
  49.                 padding: 5px;
  50.                 border: 1px solid black;
  51.                 background-color: #ddd;
  52.             }
  53.             #login, #verberge_loginbox, #zeige_loginbox{
  54.                 border-radius: 20px;
  55.                 background-color: #ffe4b5;
  56.                 box-shadow: 0 12px 16px 0 rgba(0,0,0,0.2), 0 ipx 50px 0 rgba(0,0,0,0.19);
  57.             }
  58.             #verberge_loginbox{
  59.                 position: absolute;
  60.                 top: 5px;
  61.                 right: 5px;
  62.             }
  63.             .loginformular_eingabefeld{
  64.                 border-radius: 20px;
  65.             }
  66.             #login_fehler{
  67.                 color: #f00;
  68.             }
  69.         </style>
  70.     </head>
  71.     <body>
  72.         <input type="button" id="zeige_loginbox" value="Login" />
  73.         <div id="loginbox">
  74.             <input type="button" id="verberge_loginbox" value="X" />
  75.             <form method="post" action="<?php echo $_SERVER['SCRIPT_NAME']; ?>">
  76.                 <?php if($login_ok === false){ ?><span id="login_fehler">Falsche Email/Falsches Passwort</span><?php } ?>
  77.                 <dl>
  78.                     <dt>Email:</dt><dd><input class="loginformular_eingabefeld" id="form_email" name="form_email" type="text" /></dd>
  79.                     <dt>Passwort:</dt><dd><input class="loginformular_eingabefeld" id="form_passwort" name="form_passwort" type="password" /></dd>
  80.                 </dl>
  81.                 <input id="login" type="submit" id="login" value="Einloggen" />
  82.             </form>
  83.             <a href="registrierung.php" target="_blank" id="registrieren">Noch nicht angemeldet, jetzt registrieren</a>
  84.         </div>
  85.         <script>
  86.             document.getElementById('zeige_loginbox').addEventListener('click',
  87.                 function(){
  88.                     document.getElementById('loginbox').style.display = 'block';
  89.                 }
  90.             );
  91.             document.getElementById('verberge_loginbox').addEventListener('click',
  92.                 function(){
  93.                     document.getElementById('form_email').value = '';
  94.                     document.getElementById('form_passwort').value = '';
  95.                     document.getElementById('loginbox').style.display = 'none';
  96.                 }
  97.             );
  98.         </script>
  99.     </body>
  100. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement