Advertisement
Guest User

law

a guest
Apr 25th, 2017
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.97 KB | None | 0 0
  1. <?php
  2. session_start();
  3.  
  4. if (isset($_POST['uname'])){
  5. $uname = $_POST['uname'];
  6. $pass = $_POST['pass'];
  7.  
  8. if ($uname=="lawrence" && $pass=="lawrencepogi"){
  9. $_SESSION['kahitano']='walang kwenta';
  10. }
  11. else
  12. echo "Username or Password does not match!";
  13. }
  14.  
  15. if(isset($_SESSION['kahitano'])){
  16.  
  17. echo "<table border =\"1\" style='border-collapse: collapse'>";
  18.  
  19. for ($row=1; $row<=10; $row++){
  20.  
  21. $color = "#377d7a";
  22. if ($row%2) $color = "#0000";
  23.  
  24. echo"<tr style = \"background-color:$color\">";
  25.  
  26. for ($col=1; $col<=10; $col++){
  27.  
  28. $answer = $row * $col;
  29.  
  30. echo"<td>$answer</td>";
  31.  
  32. }
  33.  
  34. }
  35. echo "</table>";
  36. }
  37. else
  38. { ?>
  39.  
  40. <form action="index.php" method="post">
  41. <label>Username: <input type="text" name="uname" placeholder="Username"></label><br><br>
  42. <label>Password: <input type="password" name="pass" placeholder="Password"></label><br><br>
  43. <input type="Submit" name="Login"><br>
  44. </form>
  45. <?php
  46. }
  47.  
  48.  
  49. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement