Advertisement
Guest User

Untitled

a guest
Jan 16th, 2017
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.74 KB | None | 0 0
  1. <?php
  2.  
  3. //sessie starten voor het inloggen
  4.  
  5.  
  6.  
  7. session_start();
  8. $success = "";
  9. $form = '<form method="post" action="">
  10. <table>
  11. <p style="font-size: 25px;">Login</p>
  12. <tr>
  13. <td>Username</td>
  14. <td> :</td>
  15. <td><input type="text" placeholder="Username" name="username"></td>
  16. </tr>
  17. <tr>
  18. <td>Password</td>
  19. <td> :</td>
  20. <td><input type="password" placeholder="password" name="password"></td>
  21. </tr>
  22. <tr>
  23. <td><input id="Login" type="submit" class="btn" placeholder="login" name="Login"></td>
  24. </tr>
  25. </table>
  26. </form>
  27. <?php echo $success;?>';
  28. $menu = "";
  29. if ($_POST)
  30. {
  31. if (isset($_POST["username"]))
  32. {
  33. $username = $_POST["username"];
  34. $password = $_POST["password"];
  35.  
  36. //if username=admin en if password = admin , login!
  37. if(isset($_POST['Login']))
  38. {
  39. if($username == "admin" && $password == "admin")
  40. {
  41. $success = "Logged in as Administrator!";
  42. $_SESSION['Login'] = true;
  43.  
  44. print_r($_SESSION);
  45.  
  46. if(isset($_SESSION) && $_SESSION['Login'] == true)
  47. {
  48. $menu = '<a href="http://mainware.gq/" target="target_frame"><button class="btn">Admin</button></a>';
  49. $form = '<form method="post" action=""><input id="Logout" type="submit" name="Logout" class="btn">
  50. </form>';
  51.  
  52. if(isset($_POST['Logout']))
  53. {
  54. session_destroy();
  55. }
  56. }
  57. }
  58. else
  59. {
  60. $success = "Wrong/No Credentials!";
  61. }
  62. }
  63. }
  64. }
  65.  
  66. ?>
  67. <html>
  68. <head>
  69. <link rel="stylesheet" type="text/css" href="./css/style.css">
  70.  
  71.  
  72. </head>
  73.  
  74. <body onload="">
  75. <table width="80%" border="0" >
  76. <tr width="100%">
  77. <th width="80%"><p id="Title" style="color: white; font-size: 40px;" >&#9763; Website van Joshua Altena &#9763;</p></th><br>
  78. </tr>
  79. </table>
  80.  
  81.  
  82. <table id="table2">
  83. <tr>
  84. <th valign="top">
  85. <a href="http://mainware.gq/"> <img class="imgeye" src="./images/eye.png"><a href="http://mainware.gq/"></img> </a>
  86. <a href="./websites/Home.php" target="target_frame"><button class="btn">Home</button></a> <br><br><br><br>
  87. <a href="./websites/gallery.html" target="target_frame"><button class="btn">Gallery</button> </a><br><br><br><br>
  88. <a href="./websites/About.php" target="target_frame"><button class="btn">About</button></a> <br><br><br><br>
  89. <a href="./websites/Contact.php" target="target_frame"><button class="btn">Contact</button></a> <br><br><br>
  90. <?php echo $menu;?>
  91. &copy; by Joshua Altena
  92. </th>
  93. <th valign="top" height="100%" width="90%">
  94. <iframe src="./websites/Home.php" name="target_frame" width="100%" height="100%"></iframe>
  95. </th>
  96. <th valign="top">
  97. <?php echo $success; echo $form;?>
  98. </th>
  99. </tr>
  100. </table>
  101. <br>
  102. </body>
  103. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement