Advertisement
Guest User

Untitled

a guest
Sep 20th, 2017
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.27 KB | None | 0 0
  1. <?php
  2. $time = time();
  3. $time15 = time() + (15 * 60);
  4. session_start();
  5. $dbuser="na";
  6. $dbpass="na";
  7. $dbname = "na";
  8. $chandle = mysql_connect("$dbhost", $dbuser, $dbpass)
  9. or die("Connection Failure to Database");
  10. mysql_select_db($dbname, $chandle) or die ($dbname . " Database not found." . $dbuser);
  11. $playerClan = 0;
  12. $playerId = -1;
  13. $mysql = mysql_query("SELECT * FROM uber3_players where name='".$username."' and pass='".$password."' LIMIT 1") or die(mysql_error());
  14. while($row = mysql_fetch_assoc($mysql)){
  15. $playerId = $row['id'];
  16. $playerClan = $row['ClanID'];
  17. }
  18. function loggedIn() {
  19. if(isset($_SESSION['username'])) {
  20. $username = $_SESSION['username'];
  21. $password = $_SESSION['password'];
  22. $mysql = mysql_query("SELECT * FROM uber3_players where name='".$username."' and pass='".$password."' LIMIT 1") or die(mysql_error());
  23. $destroy = true;
  24. while($row = mysql_fetch_assoc($mysql)){
  25. $_SESSION['dbid'] = $row['id'];
  26. $_SESSION['mgroup'] = $row['mgroup'];
  27. $destroy = false;
  28. }
  29. if($destroy) {
  30. echo 'Your password has changed. You must relogin.';
  31. session_destroy();
  32. return false;
  33. }
  34. echo $playerClan;
  35. return true;
  36. } else {
  37. echo 'Welcome guest, please <a href="login.php">Login</a> or <a href="create.php">Register</a>.';
  38. }
  39. return false;
  40. }
  41. ?>
  42. <fieldset>
  43. <h2><span>Item Id List</span></h2><div class="clr"></div>
  44. <p>
  45. <center>Please enter an item name below and click 'Search'.<br><br></center>
  46. <form method=get>
  47. <input type=hidden name=action value=items>
  48. <input style="font-decoration:italics;" name=item value="<?php echo $_GET['item']; ?>">
  49. <input type=submit value=Search>
  50. </form>
  51. <table width=100%>
  52. <?php
  53. if(isset($_GET['item'])) {
  54. $getting = mysql_query("SELECT COUNT(`id`) FROM search WHERE name LIKE '%".$_GET['item']."%'");
  55. $cnt = mysql_result($getting, 0);
  56. $name = $row['name'];
  57. $mysql = mysql_query("SELECT * FROM uber3_items WHERE name LIKE '%".$_GET['item']."%'") or die(mysql_error());
  58. while($row = mysql_fetch_assoc($mysql)){
  59. echo "Your search for $name returned ".$cnt." results";
  60. echo '<tr><td>'.$row['id'].'</td><td>'.$row['name'].'</td></tr>';
  61. }
  62. }
  63. ?>
  64. </table></p>
  65. <p>
  66.  
  67. <?php
  68. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement