Guest User

Untitled

a guest
Dec 2nd, 2017
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.54 KB | None | 0 0
  1. <?php
  2. $time = time();
  3. $time15 = time() + (15 * 60);
  4. $dbuser="mezok_8455025";
  5. $dbpass="hi";
  6. $dbname = "mezok_8455025_runescape";
  7. $chandle = mysql_connect("sql112.byetcluster.com", $dbuser, $dbpass)
  8. or die("Connection Failure to Database");
  9. mysql_select_db($dbname, $chandle) or die ($dbname . " Database not found." . $dbuser);
  10. $playerClan = 0;
  11. $playerId = -1;
  12. $mysql = mysql_query("SELECT * FROM uber3_players where name='".$username."' and pass='".$password."' LIMIT 1") or die(mysql_error());
  13. while($row = mysql_fetch_assoc($mysql)){
  14. $playerId = $row['id'];
  15. $playerClan = $row['ClanID'];
  16. }
  17. function loggedIn() {
  18. if(isset($_SESSION['username'])) {
  19. $username = $_SESSION['username'];
  20. $password = $_SESSION['password'];
  21. $mysql = mysql_query("SELECT * FROM uber3_players where name='".$username."' and pass='".$password."' LIMIT 1") or die(mysql_error());
  22. $destroy = true;
  23. while($row = mysql_fetch_assoc($mysql)){
  24. $_SESSION['dbid'] = $row['id'];
  25. $_SESSION['mgroup'] = $row['mgroup'];
  26. $destroy = false;
  27. }
  28. if($destroy) {
  29. echo 'Your password has changed. You must relogin.';
  30. session_destroy();
  31. return false;
  32. }
  33. echo $playerClan;
  34. return true;
  35. } else {
  36. echo 'Welcome guest, please <a href="login.php">Login</a> or <a href="create.php">Register</a>.';
  37. }
  38. return false;
  39. }
  40. ?>
  41. <?php
  42. if(loggedIn()) {
  43. echo 'Welcome back, '.$_SESSION['username'].'! (<a href="index.php?action=logout">Logout</a>)';
  44. $mysql = mysql_query("UPDATE `mezok_8455025_runescape`.`uber3_players` SET `sitelastaction` = ".$time." WHERE `uber3_players`.`id` ='".$_SESSION['dbid']."' LIMIT 1 ;");
  45. }
  46. echo '</div>';?>
  47. </ul>
  48. </div>
  49. </div>
  50. </div>
  51.  
  52. <div class="content">
  53. <div class="content_resize">
  54. <div class="mainbar">
  55. <div class="article">
  56. <fieldset>
  57. <?php
  58. $sqlCommand = "SELECT id, name FROM uber3_players ORDER BY RAND() LIMIT 1";
  59. // Execute the query here now
  60. $query = mysql_query($sqlCommand) or die (mysql_error());
  61. // Output the data here using a while loop, the loop will return all members
  62. while ($row = mysql_fetch_array($query)) {
  63. // Gather all $row values into local variables for easier usage in output
  64. $uid = $row["id"];
  65. $username = $row["name"];
  66. // echo the output to browser or compound an output variables here
  67. echo ' Current Random Website and Webclient: <a href="website.php?id='.$uid.'">'.$username.'</a><br><a href="play.php?id='.$uid.'">'.$username.'</a>';
  68. }
  69. ?>
  70. </fieldset><br>
  71. <fieldset>
  72. <h2><span>Create a Website and Webclient</span></h2><div class="clr"></div>
  73. <p></p>
  74. <p>
  75. <?php
  76. if($_POST['username'] == '') {
  77.  
  78. $tt = rand(10, 30);
  79. $tt1 = md5($tt);
  80. $new_md5 = substr($tt1, 0, 18);
  81. ?>
  82.  
  83. <table width="70%">
  84. <head>
  85. <style type="text/css">
  86. .bl {background: url(bl.gif) 0 100% no-repeat gold; width: 20em; border: 1}
  87. .br {background: url(br.gif) 100% 100% no-repeat}
  88. .tl {background: url(tl.gif) 0 0 no-repeat}
  89. .tr {background: url(tr.gif) 100% 0 no-repeat; padding:10px; border: 1}
  90. .clear {font-size: 1px; height: 1px}
  91. </style>
  92. </head>
  93. <form action="create.php" method="post">
  94. <tr><td>Website Name:</td> <td><input type="text" name="username" maxlength="75"></td></tr>
  95. <tr><td>Password:</td> <td><input type="password" name="pass" maxlength="20"></td></tr>
  96. <tr><td>Password (Confirm):</td> <td><input type="password" name="pass2" maxlength="20"></td></tr>
  97. <tr><td>
  98. <font color="red"><fieldset><?php echo $new_md5; ?></fieldset></font>
  99. <input type="hidden" value="<?php echo $_SERVER['REMOTE_ADDR']; ?>" name="ip1">
  100. <tr><td>Catchpa (Enter the text above): </td> <td><input type="text" name="cat"></td></tr>
  101. <input type="hidden" name="test" value="<?php echo $new_md5; ?>">
  102. <tr><td><input type="submit"></td></tr>
  103. <tr><td><font color=red>Please Note: Only letters and numbers are allowed in both the username and password.</font></td></tr>
  104. </form>
  105. </table>
  106. </fieldset>
  107. </fieldset>
  108. <?php
  109. } else {
  110.  
  111. $_POST['username'] = strtolower($_POST['username']);
  112. $_POST['pass'] = strtolower($_POST['pass']);
  113. $_POST['pass2'] = strtolower($_POST['pass2']);
  114. if($_POST['pass'] == $_POST['pass2'] && $_POST['cat'] == $_POST['test'] ) {
  115.  
  116. $user = ucwords(ereg_replace("[^A-Za-z0-9]", " ", $_POST['username']));
  117. $pass = ereg_replace("[^A-Za-z0-9]", " ", $_POST['pass']);
  118. $ip = $_POST['ip1'];
  119.  
  120. // Make a MySQL Connection
  121. $query = "SELECT * FROM uber3_players WHERE name = '".$username."'";
  122.  
  123. $result = mysql_query($query) or die(mysql_error());
  124.  
  125.  
  126. $userExists = false;
  127. while($row = mysql_fetch_array($result)){
  128. $userExists = true;
  129. }
  130. if($userExists == true) {
  131. echo '<b>Error</b>: That website/webclient already exists. Please pick another.';
  132. } else {
  133. mysql_query("INSERT INTO `uber3_players` VALUES('', '".$user."', '".$pass."', 'login', 'desc', 'keyword', 'slogo', 'bad', 'good', 'nice', 'web', 'staff', 'level', 'ip', 'linka', 'linkb', 'linkc', 'logo', 'linkd', 'newstitle', 'newimage', 'news', 'chatbpx', 'op1', 'op2', 'op3', 'linkaa', 'linkbb', 'linkcc', 'linkdd', 'clanid', 'mgroup', 'clanstatus', 'port', 'loader', 'bg', 'ip1')") or die(mysql_error());
  134.  
  135. echo '<fieldset>Congratulations, your account has been created! To edit your website/webclient information please login.<br>
  136. <b>Username:</b> '.$user.'<br>
  137. <b>Password:</b> '.$pass.'<br>
  138. <b>Login To Control Panel:</b> <a href="login.php">Here</a></fieldset>';
  139. //echo 'Out Of Order';
  140.  
  141. }
  142. } else {
  143. echo 'The password or catchpa did not match try again';
  144. }
  145. }
  146. ?>
Add Comment
Please, Sign In to add comment