Advertisement
Guest User

Untitled

a guest
Jun 20th, 2019
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. <?php
  2. session_start();
  3. $conn = mysql_connect("localhost", "root", "");
  4. mysql_select_db("proyecto_final");
  5.  
  6. $query = "SELECT Tipo FROM registro WHERE Usuario='$usuario' AND Passw='$passw'";
  7. $result = mysqli_query($query);
  8.  
  9. echo $result;
  10.  
  11. $row = mysqli_fetch_array($result);
  12.  
  13. if($row["Tipo"]=='Profesor'){
  14. header ("Location: ../principal_profe.html");
  15. exit();
  16. }
  17. else if($row["Tipo"]=='Admin'){
  18. header ("Location: ../principal_admin.html");
  19. exit();
  20. }
  21. else{
  22. header ("Location: Index.html");
  23. exit();
  24. }
  25. mysqli_close($conn);
  26. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement