Advertisement
Guest User

Untitled

a guest
Aug 20th, 2019
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.39 KB | None | 0 0
  1. <?php
  2. session_start();
  3.  
  4. $con = mysqli_connect('localhost','root');
  5. if($con){
  6. echo " conection successful";
  7. }else{
  8. echo"connection failed";
  9. }
  10. $db = mysqli_select_db($con, ' cbe schedular ');
  11. if(isset($_POST['submit'])){
  12. $email= $_POST ['email'];
  13. $password = $_POST['password'];
  14. $sql =" select *from admin where email = '$email' and password ='$password'";
  15. $query = mysqli_query($con,$sql);
  16. $row = mysqli_num_rows(){
  17. if($row == true){
  18. echo"login susccessful";
  19. $_SESSION['user'] = $username;
  20. header('location : adminmainpage.php');
  21. }else{
  22. echo "login failed";
  23. header('location:adminlogin.php');
  24. }
  25. ?>
  26.  
  27. <?php
  28. session_start();
  29.  
  30. $con = mysqli_connect('localhost','root');
  31. if($con){
  32. echo " conection successful";
  33. }else{
  34. echo"connection failed";
  35. }
  36. $db = mysqli_select_db($con, ' cbe_schedular ');
  37. if(isset($_POST['submit'])){
  38. $email= $_POST ['email'];
  39. $password = $_POST['password'];
  40. $sql =" select *from admin where email = '$email' and password ='$password'";
  41. $query = mysqli_query($con,$sql);
  42. $row = mysqli_num_rows();
  43. if($row == true){
  44. echo"login susccessful";
  45. $_SESSION['user'] = $username;
  46. header('location :../adminmainpage.php');
  47. }else{
  48. echo "login failed";
  49. header('location:adminlogin.php');
  50. }
  51. }
  52.  
  53. $row = mysqli_num_rows(){
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement