Guest User

Untitled

a guest
Dec 2nd, 2017
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.89 KB | None | 0 0
  1. <?php
  2. $time = time();
  3. $time15 = time() + (15 * 60);
  4. session_start();
  5. $dbuser="mezok_8455025";
  6. $dbpass="mmm";
  7. $dbname = "mezok_8455025_runescape";
  8. $chandle = mysql_connect("sql112.byetcluster.com", $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="index.php?action=login">Login</a> or <a href="index.php?action=register">Register</a>.';
  38. }
  39. return false;
  40. }
  41. ?>
  42. <?php
  43. if(loggedIn()) {
  44. echo 'Welcome back, '.$_SESSION['username'].'! (<a href="index.php?action=logout">Logout</a>)';
  45. $mysql = mysql_query("UPDATE `mezok_8455025_runescape`.`uber3_players` SET `sitelastaction` = ".$time." WHERE `uber3_players`.`id` ='".$_SESSION['dbid']."' LIMIT 1 ;");
  46. }
  47. echo '</div>';?>
  48. </ul>
  49. </div>
  50. </div>
  51. </div>
  52.  
  53. <div class="content">
  54. <div class="content_resize">
  55. <div class="mainbar">
  56. <div class="article">
  57. <fieldset>
  58. <?php
  59. $sqlCommand = "SELECT id, name FROM uber3_players ORDER BY RAND() LIMIT 1";
  60. // Execute the query here now
  61. $query = mysql_query($sqlCommand) or die (mysql_error());
  62. // Output the data here using a while loop, the loop will return all members
  63. while ($row = mysql_fetch_array($query)) {
  64. // Gather all $row values into local variables for easier usage in output
  65. $uid = $row["id"];
  66. $username = $row["name"];
  67. // echo the output to browser or compound an output variables here
  68. echo ' Current Random Website and Webclient: <a href="website.php?id='.$uid.'">'.$username.'</a><br><a href="play.php?id='.$uid.'">'.$username.'</a>';
  69. }
  70. ?>
  71. </fieldset><br>
  72. <fieldset>
  73. <h2><span>Modification Complete</span></h2><div class="clr"></div>
  74. <p></p>
  75. <p><?php
  76.  
  77. require_once("config.php");
  78. echo "<title>Profile modification</title>";
  79. $username = $_SESSION['username'];
  80. $password = $_SESSION['password'];
  81.  
  82. if($_SESSION['username']){
  83. if($_POST['update']){
  84. $search = mysql_query("SELECT * FROM uber3_players WHERE name='".$username."' and pass='".$password."' LIMIT 1") or die(mysql_error);
  85. $row = mysql_fetch_assoc($search) or die(mysql_error);
  86. $idU = $_SESSION['username'];
  87. $id = $row['id'];
  88. if($_POST['newP'] && $_POST['newK'] && $_POST['newO'] && $_POST['newM'] && $_POST['newN'] && $_POST['newZ'] && $_POST['newY'] && $_POST['newX'] && $_POST['newW'] && $_POST['new1'] && $_POST['new2'] && $_POST['new3'] && $_POST['new4'] && $_POST['new5'] && $_POST['new6'] && $_POST['new7'] && $_POST['new8'] && $_POST['new9'] && $_POST['new10'] && $_POST['new11']){
  89. $update_one = mysql_query("UPDATE `uber3_players` SET `description` = '".$_POST['newP']."',`keywords` = '".$_POST['newK']."',`slogo` = '".$_POST['newO']."',`ip` = '".$_POST['newM']."',
  90. `linka` = '".$_POST['newN']."',`linkb` = '".$_POST['newZ']."',`linkc` = '".$_POST['newY']."',`linkd` = '".$_POST['newW']."',`linkaa` = '".$_POST['new7']."',`linkbb` = '".$_POST['new8']."',`linkcc` = '".$_POST['new9']."',`linkdd` = '".$_POST['new10']."',`logo` = '".$_POST['newX']."',`newstitle` = '".$_POST['new1']."',`newsimage` = '".$_POST['new2']."',`news` = '".$_POST['new3']."',`op1` = '".$_POST['new4']."',`op2` = '".$_POST['new5']."',`op3` = '".$_POST['new6']."',`chatbox` = '".$_POST['new11']."',`webclient` = '".$_POST['new15']."',`bad` = '".$_POST['new100']."',`good` = '".$_POST['new200']."',`nice` = '".$_POST['new300']."',`port` = '".$_POST['new101']."',`loader` = '".$_POST['new103']."',`background` = '".$_POST['new104']."' WHERE `uber3_players`.`name` = '".$_SESSION['username']."';
  91. ");
  92. echo "Profile modified, click <a href='list.php'>here</a> to view the website/webclient list<br>";
  93. echo "Click <a href='cpanel.php'>here</a> to go back to the Control Panel</fieldset>
  94. </fieldset>";
  95. }
  96. else{
  97. echo "All fields must be filled in...";
  98. }
  99. }
  100.  
  101. }else{
  102. echo "You are not logged in";
  103. }
  104. ?>
  105. </p>
  106. </div>
  107. </div>
  108.  
  109. <?php
  110. ?>
Add Comment
Please, Sign In to add comment