Advertisement
Guest User

help

a guest
Mar 5th, 2015
214
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.76 KB | None | 0 0
  1. <?php
  2.     session_start();
  3.     include_once "config.php";
  4.     require_once('classes/BD.classes.php');
  5.     BD::conn();
  6. ?>
  7. <!DOCTYPE HTML>
  8. <html lang="pt-BR">
  9.     <head>
  10.         <meta charset=UTF-8>
  11.         <title>entra no chat</title>
  12.         <style type="text/css">
  13.          *{margin:0; padding:0;}
  14.             body{
  15.                 background-color:#f4f4f4;
  16.                 /*aqui eu queria uma transicao*/
  17.             }
  18.             div#formulario{width:500px;padding:5px; height:95px;background:#fff;border:1px solid green;
  19.               position:absolute;left:50%;top:50%;margin-left:-250px;margin-top:40px;
  20.             }
  21.             div#formulario span{font:18px "Trebuch MS",Tahoma,arial;color:#036;float:left;width:100%;margin-bottom: 10px;}
  22.             div#formulario input[type=text]{
  23.                 padding: 5px;
  24.                 width: 487px;
  25.                 border:1px solid #ccc;
  26.                 outline: none;
  27.                 font:16px, tahoma,arial,#666;
  28.                 border-color: #BEBEBE; transition:border-color .3s;}
  29.                 div#formulario input[type=text]:focus{
  30.                     border-color: green;
  31.                     box-shadow: 0px 0px 6px 0px green;
  32.                     transition: border-color .3s;
  33.                     transition: box-shadow .5s;  
  34.                 }
  35.                 div#formulario input[type=submit]{
  36.                     padding:4px 6px; background: #069;font:15px tahoma,arial;color:#fff;border:1px solid #036;
  37.                     float:left;margin-top:5px; text-align:center;width:95px; text-shadow:#000 0 1px 0;
  38.                 }
  39.                 div#formulario input[type=submit]:hover{cursor:pointer;background: #7FFF00; transition:background 1s;} 
  40.          }
  41.         </style>
  42.     <head>
  43. <body>
  44.     <?php
  45.            if(isset($_POST['acao']) && $_POST['acao'] == 'logar'):
  46.             $email = strip_tags(filter_input(INPUT_POST,'email',FILTER_SANITIZE_STRING));
  47.            if($email == ''){}else{
  48.             $pegar_user = BD::conn()->prepare("SELECT id FROM 'usuarios' WHERE email = ?");
  49.             $pegar_user->execute(array($email));
  50.             if($pegar_user->rowCount() == 0){
  51.                 echo '<script>alert("Usuario não encontrado")</script>';
  52.             }
  53.            }else{
  54.             $fetch = $pegar_user->fetchObject();
  55.             $_SESSION['id_user'] = $fetch->id;
  56.             echo '<script>alert("login efetuado");location.href="chat.php"</script>';
  57.            }
  58.        }
  59.         endif;
  60. ?>
  61.    <div id="formulario">
  62.     <span>Digite seu e-mail</span>
  63.        <form action="#" method="post" enctype="multipart/form-data">
  64.               <label>
  65.                 <input type="text" name="email"/>
  66.               </label>
  67.                 <input type="hidden" name="email" value="logar"/>
  68.                 <input type="submit" value="Logar"/>
  69.        </form>
  70.    </div>
  71. </body>
  72. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement