Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- include 'conn.php';
- session_start();
- if(isset($_GET['ass'])){
- $_SESSION['admin'] = '1';
- header("Location: index.php");
- }
- if(isset($_POST['mail'])){
- $mail = $_POST['mail'];
- $pass = md5($_POST['pass']);
- $sql = "SELECT * FROM user WHERE email='$mail' and senha='$pass'";
- $qsl = mysqli_query($conn, $sql);
- $user = mysqli_fetch_assoc($qsl);
- $conta = mysqli_num_rows($qsl);
- if($conta>0){
- $id = $user['id'];
- echo $id;
- $_SESSION['admin'] = $id;
- $_SESSION['post'] = 'Bem vindo de volta!';
- header("Location: index.php");
- }else{
- $_SESSION['loginerro'] = 'Não foi possivel fazer login!';
- header("Location: index.php");
- }
- header("Location: index.php");
- exit();
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement