Advertisement
Guest User

Untitled

a guest
Nov 22nd, 2016
186
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.59 KB | None | 0 0
  1. ----------------------------------------------------------- LOGREG
  2.  
  3. <?php
  4. $cookie_name = "loggedin";
  5.  
  6. $servername ="localhost";
  7. $username = "root";
  8. $password ="";
  9. $database="shimmerian_mods";
  10.  
  11. $conn = mysqli_connect("localhost","root", "", "shimmerian_mods");
  12.  
  13. if (!$conn) {
  14. die("Database connection failed: ".mysqli_connect_error());
  15. }
  16.  
  17. if(isset($_POST['login']))
  18. {
  19. $user = $_POST['username'];
  20. $pass = $_POST['password'];
  21.  
  22. $phash = sha1(sha1($pass."salt")."salt");
  23.  
  24. $sql = "SELECT * FROM users WHERE username='$user' AND password ='$phash';";
  25.  
  26. $result = mysqli_query($conn, $sql);
  27. $count = mysqli_num_rows($result);
  28.  
  29. if ($count == 1)
  30. {
  31. $cookie_value = $user;
  32. setcookie($cookie_name, $cookie_value, time() + (180), "/");
  33. header("Location: personal.php");
  34. }
  35. else{
  36. echo "Username or password is incorrect";
  37. }
  38. }
  39. else if (isset($POST['register']))
  40. {
  41. $user = $_POST['username'];
  42. $pass = $_POST['password'];
  43.  
  44. $phash = sha1(sha1($pass."salt")."salt");
  45.  
  46. $sql = "INSERT INTO users (id, username, password) VALUES ('', '$user', '$phash')";
  47.  
  48. $result = mysqli_query($conn, $sql);
  49.  
  50. }
  51. ?>
  52.  
  53. ----------------------------------------------------PERSONAL.PHP
  54.  
  55. <? php
  56. $cookie_name = "loggedin";
  57. if (isset($_COOKIE[$cookie_name]))
  58. {
  59. $cookie_value = $_COOKIE[$cookie_name];
  60. echo "Welcome to your personal area $cookie_value!";
  61. echo '<a href=logout.php>Logout</a>';
  62. }
  63. ?>
  64.  
  65. ----------------------------------------------------LOGOUT.PHP
  66.  
  67. <?php
  68. setcookie("loggedin", "val", time() - (120) "/");
  69. header ("Location: index.php");
  70. ?>
  71.  
  72. ---------------------------------------------------INDEX.PHP
  73.  
  74. <!DOCTYPE html>
  75. <html lang="en">
  76. <head>
  77. <meta charset="utf-8" />
  78. <title>Shimmerian Mods</title>
  79. <meta name="viewport" content="width=device-width", initial-scale=1.0>
  80. <link rel="stylesheet" href="blueberry.css"/>
  81. <link rel="stylesheet" href="mainStyle.css"/>
  82. <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js"></script>
  83. <script src="jquery.blueberry.js"></script>
  84. <script>
  85. $(window).load(function() {
  86. $('.blueberry').blueberry();
  87. });
  88. </script>
  89. </head>
  90. <body>
  91.  
  92. <header>
  93. <a href="#" id="logo"></a>
  94. <nav>
  95. <a href="#" id="menu-icon"></a>
  96. <ul>
  97. <li><a href="#" class="current">Home</a></li>
  98. <li><a href="#">Our Forums</a></li>
  99. <li><a href="#">Our Staff</a></li>
  100. <li><a href="#">Affiliates</a></li>
  101. </ul>
  102. </nav>
  103. </header>
  104. <div id="doc">
  105. <div id="content">
  106. <div class="blueberry">
  107. <ul class="slides">
  108. <li><img src="shimmersword1.jpg"></li>
  109. <li><img src="shimmersword2.jpg"></li>
  110. <li><img src="shimmerswordbackground.jpg"></li>
  111. </ul>
  112. </div>
  113. </div>
  114. </div>
  115. <section>
  116. <img src="shimmersword.png">
  117. <h1>A New Way To Access Mods</h1>
  118. <p>We plan on supplying you with an active and easily updatable means to access, maintain and download the mods that you guys love, or even created yourselves!</p>
  119. </section>
  120. <section>
  121. <img src="shimmersword.png">
  122. <h1>Active Staff Team</h1>
  123. <p>Our staff team is compiled of people that know what they're doing, since they're people just like you. And you can even become one of us!</p>
  124. </section>
  125. <section>
  126. <img src="shimmersword.png">
  127. <h1>Gamers Just Like You</h1>
  128. <p>Know how desensatized most people are to this sort of thing. We on the other hand have played a large quantity of mods and understand the demand for a fair system to upload and develop your mods.</p>
  129. </section>
  130.  
  131. <form action="logreg.php" method="post" accept-charset="utf-8">
  132. <label>Username:</label><input type="text" name="username" value="" placeholder>
  133. <br/>
  134. <label>Password:</label> <input type="password" name="password" value=" " placeholder>
  135. <br />
  136. <input type="submit" name="login" value="Login">
  137. <input type="submit" name="register" value="Register">
  138. </form>
  139.  
  140. <div class="clear"></div>
  141. <article>
  142. <img src="shimmersword.png">
  143. </article>
  144. <aside>
  145. <h2>Sponsored by the Shimmersword Gaming Community</h2>
  146. <ul class="sponsor">
  147. <li><h3>"Ours Is The Sword"</h3></li>
  148. <li><h3>"The Community Wants You!</h3></li>
  149. </ul>
  150. </aside>
  151. <div class="clear"></div>
  152. <section>
  153. <img src="shimmersword.png">
  154. <h1>Becoming A Modder</h1>
  155. <p>It's as easy as signing up on our website. Feel free to also browse the files that other members of the community have uploaded.</p>
  156. </section>
  157. <section>
  158. <img src="shimmersword.png">
  159. <h1>Becoming a Moderator</h1>
  160. <p>The community always needs help from members of the community that wish to do something more. We will be opening applications shortly so you may help, review and help us with mods and issues within the playerbase.</p>
  161. </section>
  162. <section>
  163. <img src="shimmersword.png">
  164. <h1>Improvements Always Being Made</h1>
  165. <p>This website is always bound to change due to improvements being made. So please, bear with us while these occur!</p>
  166. </section>
  167. <footer class="first">
  168. <section>
  169. <h3>Shimmerian Gaming</h3>
  170. <p>Shimmerian Websites <br>
  171. Created and Maintained by <br>
  172. Oliver "Rek" Holliday</p>
  173. </section>
  174. <section>
  175. <h3>Connect to our Community</h3>
  176. <ul class="social">
  177. <li><a href="#"><img src="shimmersword.png"></a></li>
  178. <li><a href="#"><img src="shimmersword.png"></a></li>
  179. <li><a href="#"><img src="shimmersword.png"></a></li>
  180. <li><a href="#"><img src="shimmersword.png"></a></li>
  181. </ul>
  182. </section>
  183. <section>
  184. <img src="shimmersword.png">
  185. </section>
  186. </footer>
  187. <footer class="second">
  188. <p>©Shimmerian 2016</p>
  189. </footer>
  190. </body>
  191. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement