Advertisement
Guest User

Untitled

a guest
Jun 24th, 2017
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.60 KB | None | 0 0
  1. <?php
  2. session_start();
  3. ?>
  4.  
  5. <html>
  6. <head>
  7. <title>Testaan toimiiko ;3</title>
  8. </head>
  9.  
  10.  
  11. <style type="text/css">
  12. html, body {
  13. height: 100%;
  14. margin: 0;
  15. padding: 0;
  16. }
  17.  
  18. img#bg {
  19. position:fixed;
  20. top:0;
  21. left:0;
  22. width:100%;
  23. height:100%;
  24. }
  25.  
  26. #content {
  27. position:relative;
  28. z-index:1;
  29. }
  30.  
  31. </style>
  32.  
  33. <!--[if IE 6]>
  34. <style type="text/css">
  35. html { overflow-y: hidden; }
  36. body { overflow-y: auto; }
  37. #bg { position:absolute; z-index:-1; }
  38. #content { position:static; }
  39. </style>
  40. <![endif]-->
  41.  
  42. <body>
  43. <img src="squid.jpg" alt="background image" id="bg" />
  44. </body>
  45.  
  46.  
  47.  
  48. <center>
  49. <br>
  50. <br>
  51. <br>
  52. <br>
  53. <br>
  54. <br>
  55. <br>
  56. <br>
  57.  
  58. <div id="content">
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67. <form action="kirjautuminen.php" method="post">
  68.  
  69. <input type="text" name="kayttajanimi" value="Käyttäjänimi"><br>
  70.  
  71. <input type="password" name="salasana" value="Salasana"><br><br>
  72.  
  73. <input type="submit" name="nappi1" value="Kirjaudu Sisään"><br><br>
  74.  
  75.  
  76. </form>
  77.  
  78.  
  79.  
  80.  
  81.  
  82. <?php
  83.  
  84. $_SESSION['user'] = $_POST['kayttajanimi'];
  85. $_SESSION['pwd'] = $_POST['salasana'];
  86.  
  87. if (isset($_POST['nappi1'])) {
  88.  
  89. if(($_SESSION['user'] == admin) and ($_SESSION['pwd'] == 1234)) {
  90. echo '<html><head><META HTTP-EQUIV="refresh" CONTENT="3;URL=sivu1.php"></head>
  91. <font color="black"><b>Kirjautuminen onnistui!</font></b><br><font color="black"><b>Odota hetki...</font></b></html>';
  92.  
  93. }
  94. else {
  95. echo '<font color="red">Kirjautuminen epäonnistui!</font>';
  96. }
  97. }
  98. else
  99. echo "";
  100.  
  101. ?>
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113. </div>
  114.  
  115. </center>
  116.  
  117. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement