Admin CP


Hey Everybody!

Here i go again.. I was going to sell this but i decided not to.
PHP Code
  1. <?
  2. session_start();
  3. include("config.php");
  4. if($logged[username] && $logged[userlevel] ==6) // allows level 5 to view this page
  5. {
  6. if($_GET[user])
  7. {
  8. if (!$_POST[update]) // if the submit button is pressed
  9. {
  10. $getuser2 = mysql_query("SELECT * from members where username = '$_GET[user]'");
  11. $user = mysql_fetch_array($getuser2);
  12. //gets the user info
  13. echo("
  14. Here you can now edit the user's infomation and etc.
  15. <hr>
  16. <form method='POST'>
  17. Username: $user[username]
  18. <hr>
  19. ");//End the echo
  20. if($logged[userlevel] == 6 && $logged[id]){
  21. echo ("Password:
  22. sha1(md5(md5(sha1(md5(sha1(sha1(md5($user[password))))))))]
  23.  
  24. <hr>
  25. ");//echo the password holy shit. lol.
  26. }else{//if they aren't an admin then echo nothing below
  27. echo('');
  28. //echo nothing
  29.  
  30. } //End else if
  31. echo ("
  32. <br>Email:<input name='email' value='$user[email]'>
  33. <hr>
  34. <br>MSN:<input name='msn' value='$user[msn]'>
  35. <hr>
  36. <br>AIM:<input name='aim' value='$user[aim]'>
  37. <hr>
  38. <br>Location:<input name='location' value='$user[location]'>
  39. <hr>
  40. Current Level: $user[level]
  41. User Level:
  42. <select size='1' name='userlevel'>
  43. <option value=\"5\">Admin</option>
  44. <option value=\"4\">Staff</option>
  45. <option value=\"3\">VIP Gold</option>
  46. <option value=\"2\">VIP Silver</option>
  47. <option value=\"1\">Members</option>
  48. </select>
  49. <hr>
  50. News Reporter:
  51. <select size='1' name='news'>
  52. <option value=\"NO\">No</option>
  53. <option value=\"YES\">Yes</option>
  54. </select>
  55. <hr>
  56. <br>
  57. Support Staff:
  58. <select size='1' name='support'>
  59. <option value=\"NO\">No</option>
  60. <option value=\"YES\">Yes</option>
  61. </select>
  62. <hr>
  63. <br>
  64. Modertor:
  65. <select size='1' name='mod'>
  66. <option value=\"NO\">No</option>
  67. <option value=\"YES\">Yes</option>
  68. </select>
  69. <hr>
  70. <input type='submit' name='update' value='Update'></td>
  71.  
  72. </form>
  73. ");// ends the echo and shows the content on top
  74. }
  75. else
  76. {
  77. $email = htmlspecialchars($_POST[email]);
  78. $msn = htmlspecialchars($_POST[msn]);
  79. $aim = htmlspecialchars($_POST[aim]);
  80. $location = htmlspecialchars($_POST[location]);
  81. $news = htmlspecialchars($_POST[news]);
  82. $support = htmlspecialchars($_POST[support]);
  83. $mod = htmlspecialchars($_POST[mod]);
  84. $level = htmlspecialchars($_POST[userlevel]);
  85. echo ("$_GET[user] has been updated."); // display's message
  86. $update = mysql_query("Update users set msn = '$msn',
  87. email = '$email', aim = '$aim', location = '$location', news = '$news', support = '$support', level = '$level', mod = '$mod' where username = '$_GET[user]'"); // updates the database
  88. }
  89. }
  90. else
  91. {
  92. $getusers = mysql_query("Select * from members order by username asc"); // gets the users
  93. while($users = mysql_fetch_array($getusers))
  94. {
  95. echo("<a href=\"admincp.php?user=$users[username]\">$users[username]</a>"); // display's all users
  96. }
  97. }
  98. }
  99. else // if your not admin
  100. {
  101. echo("Sorry, but your not allowed to view this page."); // display's message if your not admin or not logged in
  102. }
  103. ?>
.


I put ramdom things so you really have to remove it or use it and whatever, lol.


Need help our nice staff will help and users.
cyruswu's Avatar
Author:
Views:
3,809
Rating:
Posted on Friday 8th August 2008 at 01:32 AM
UrbanTwitch
UrbanTwitch's Avatar
Parse error: syntax error, unexpected ')', expecting ']' in /home/jsfdan/public_html/admincp.php on line 22
Posted on Friday 1st August 2008 at 06:34 PM
ShadowMage
ShadowMage's Avatar
Quite frankly, I think MOD-Dans was on here before this.
Posted on Friday 1st August 2008 at 04:27 PM
UrbanTwitch
UrbanTwitch's Avatar
Right here: https://rmb-scripting.com/tutorials.php?tutorial&tid=60

Mod-Dans. Compare.
Posted on Friday 1st August 2008 at 03:42 PM
DanielXP
DanielXP's Avatar
What looks a lot like his admin panel?
Posted on Friday 1st August 2008 at 03:11 PM
UrbanTwitch
UrbanTwitch's Avatar
DanielXP: I didn't call you an idiot.

Also it looks a lot like cyruswu's admin panel.
Posted on Friday 1st August 2008 at 12:19 PM
jambomb
jambomb's Avatar
Rofl exactly.
Posted on Friday 1st August 2008 at 10:51 AM
DanielXP
DanielXP's Avatar
UrbanTwit: My tutorial "User System" you need to edit it, Putting in your database info. Am I a idiot?
Posted on Friday 1st August 2008 at 10:21 AM
jambomb
jambomb's Avatar
how is he a idiot ?? bit harsh
Posted on Friday 18th July 2008 at 01:01 AM
UrbanTwitch
UrbanTwitch's Avatar
Why would you post a tutorial that we need to edit... -_-

idiot
Posted on Saturday 12th April 2008 at 01:57 PM
cyruswu
cyruswu's Avatar
It's completely ripped from my usersystem and a little edited

I designed it a little differently. Checking a row like news to say YES and it will view the news system page.

That's why it's like that.