Advertisement
Guest User

Untitled

a guest
Feb 8th, 2016
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.94 KB | None | 0 0
  1. <?php include_once("db.php")
  2. session_start();
  3. ?>
  4.  
  5. <?php
  6. $user = $_POST['name'];
  7. $pass = $_POST['pwd'];
  8.  
  9. $sql="SELECT count(*) from phplogin WHERE(username='$user' and password='$pass')";
  10.  
  11. $query = mysql_query($sql);
  12.  
  13. $result = mysql_fetch_array($query);
  14.  
  15. if($result[0] > 0) {
  16. $_SESSION['userName']=$user;
  17. echo "Succesful login!";
  18.  
  19. echo "<br /> Welcome " .$_SESSION['userName']. "!";
  20. echo "<br /><a href='signupform.php' > SignUp </a>";
  21. echo "<br /><a href='signinform.php' > SignIn </a>";
  22. echo "<br /><a href='logout.php' > LogOut </a>";
  23. }
  24. else{
  25. echo "Login failed!";
  26. echo "<br /><a href='signupform.php' > SignUp </a>";
  27. echo "<br /><a href='signinform.php' > SignIn </a>";
  28.  
  29. }
  30. ?>
  31.  
  32. <?php
  33. include_once("db.php"); // Added the missing semi-colon
  34. session_start();
  35. ?>
  36.  
  37. <?php include_once("db.php") ;//semi-colon was missing
  38. session_start();
  39. ?>
  40.  
  41. <?php include_once("db.php");
  42. session_start();
  43. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement