Advertisement
Guest User

Untitled

a guest
Jul 15th, 2017
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.80 KB | None | 0 0
  1. <?php
  2. $connection = mysqli_connect('localhost', 'id1593754_root', 'Patch201796');
  3. if (!$connection){
  4. die("Database Connection Failed" . mysqli_error($connection));
  5. }
  6. $select_db = mysqli_select_db($connection, 'id1593754_kickednetwork');
  7. if (!$select_db){
  8. die("Database Selection Failed" . mysqli_error($connection));
  9. }
  10. ?>
  11. <DOCTYPE HTML>
  12. <html>
  13. <head>
  14. <meta charset="utf-8">
  15. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  16. <meta name="viewport" content="width=device-width, initial-scale=1">
  17. <meta name="description" content="KickedNetwork">
  18. <link rel="stylesheet" href="CSS_Files/Body_Format.css">
  19. </head>
  20. <body>
  21. <nav>
  22. <div class="topnav">
  23. <a href="index.html"><font color="FF00FF">Kicked Network</a>
  24. <a class="active" href="index.php">Home</a>
  25. <a href="#">Forums</a>
  26. <a href="#">Donations</a>
  27. <a href="#">Apply</a>
  28. <a href="#">About</a>
  29. <a href="#">Contact Us</a>
  30. <form action="#">
  31. <input id="right2" type="submit" name="register" value="Register">
  32. </form>
  33. <form>
  34. <input id="right2" type="submit" name="submit" value="Login">
  35. <input id="right" type="password" name="password" placeholder="Password">
  36. <input id="right" type="text" name="username" placeholder="Username">
  37. </form>
  38. </font>
  39. </nav>
  40. </div>
  41. <div>
  42. <img width="100%" height="320" src="img/banner.jpg">
  43. <p><b>
  44. <center><u><font color="0000FF"><h1>Server Status</u></center>
  45. <div>
  46. <center><font color="BBBB00"><h1>
  47. <p>
  48. <script type="text/javascript">
  49. //<![CDATA[
  50. try{if (!window.CloudFlare) {var CloudFlare=[{verbose:0,p:0,byc:0,owlid:"cf",bag2:1,mirage2:0,oracle:0,paths:{cloudflare:"/cdn-cgi/nexp/dok9v=02fcfa4f56/"},atok:"9848c3d78ba1a15cf21436229451df3c",petok:"048a35fe6ae96387c911831bbab592e03754a611-1399735338-1800",zone:"factionsmc.net",rocket:"0",apps:{}}];CloudFlare.push({"apps":{"ape":"949d63a024fa26cd3cc918b8c8a1fc4d"}});!function(a,b){a=document.createElement("script"),b=document.getElementsByTagName("script")[0],a.async=!0,a.src="//ajax.cloudflare.com/cdn-cgi/nexp/dok9v=97fb4d042e/cloudflare.min.js",b.parentNode.insertBefore(a,b)}()}}catch(e){};
  51. //]]>
  52. </script>
  53. <link rel="shortcut icon" href="img/favicon.ico">
  54. <link href="css/bootstrap.min.css" rel="stylesheet">
  55. <link href="css/font-awesome.min.css" rel="stylesheet">
  56. <link href="css/custom.css" rel="stylesheet">
  57. <div class="progress progress-striped active">
  58. <div class="progress-bar" role="progressbar" aria-valuenow="45" aria-valuemin="0" aria-valuemax="100" style="width: 45%">
  59. <span class="sr-only"></span>
  60. <div class="PlayersOnline">Players:<span id="online"> 0</span></div>
  61. </div>
  62. </div>
  63. </style>
  64. <div id="topbarumc"><span class="ips" onclick="prompt('Copy and Paste this IP to connect to the server',this.innerHTML)">play.kickednetwork.com
  65. </span><div class="PlayersOnline">Players Online:<span id="online"> 0</span></div></div><div id="logo"></div>
  66. <script src="//use.edgefonts.net/bebas-neue.js"></script>
  67. <script>
  68. $(document).ready(function() {
  69. var ip = "play.kickednetwork.com";
  70. var xhr = new XMLHttpRequest();
  71. xhr.open("GET", "http://www.minecraft-api.com/v1/get/?server=" + ip, true);
  72. xhr.onreadystatechange = function() {
  73. if (xhr.readyState == 4) {
  74. data = JSON.parse(xhr.responseText);
  75. if (data.status) {
  76. $('#online').html(data.players.online);
  77. } else {
  78. $('#online').html(0);
  79. }
  80. }
  81. }
  82. xhr.send();
  83. });
  84. </script>
  85. <script language="javascript">
  86. function check(form)/*function to check userid & password*/
  87. {
  88. /*the following code checkes whether the entered username and password are matching*/
  89. if(form.username.value == "username" && form.password.value == "password")
  90. {
  91. window.open('target.html')/*opens the target page while Id & password matches*/
  92. }
  93. else
  94. {
  95. alert("You did not insert any fields in username or password!")/*displays error message*/
  96. }
  97. }
  98. </script>
  99. </div>
  100. </div>
  101. </body>
  102. </html>
  103. <?php //Start the Session
  104. session_start();
  105. require('connect.php');
  106. //3. If the form is submitted or not.
  107. //3.1 If the form is submitted
  108. if (isset($_POST['username']) and isset($_POST['password'])){
  109. //3.1.1 Assigning posted values to variables.
  110. $username = $_POST['username'];
  111. $password = $_POST['password'];
  112. //3.1.2 Checking the values are existing in the database or not
  113. $query = "SELECT * FROM `members` WHERE username='$username' and password='$password'";
  114.  
  115. $result = mysqli_query($connection, $query) or die(mysqli_error($connection));
  116. $count = mysqli_num_rows($result);
  117. //3.1.2 If the posted values are equal to the database values, then session will be created for the user.
  118. if ($count == 1){
  119. $_SESSION['username'] = $username;
  120. }else{
  121. //3.1.3 If the login credentials doesn't match, he will be shown with an error message.
  122. $fmsg = "Invalid Login Credentials.";
  123. }
  124. }
  125. //3.1.4 if the user is logged in Greets the user with message
  126. header('Loction: home.php');
  127. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement