Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?
- include 'init.php';
- //CONSULTA DO UTILIZADOR
- $consulta="Select * from utilizadores where email='" . $_POST['email'] . "' and password='" . $_POST['password'] . "'";
- $resultado=mysql_query($consulta);
- if (mysql_num_rows($resultado)>0) //SE O EMAIL E A PASSWORD COINCIDIREM
- {
- //COLOCA NA VARIAVEL LINHA OS DADOS DA CONSULTA
- $linha=mysql_fetch_array($resultado);
- //COLOCA O EMAIL EM SESSAO
- $_SESSION['email']=$linha['email'];
- //REDIRECCIONA A PAGINA PARA A PAGINA SECRETA
- header("location: admin.php");
- }
- else //CASO NAO COINCIDAM
- {
- //REDIRECCIONA PARA A PAGINA INICIAL REPORTANDO O ERRO
- header("location: index.php?erro=1");
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment