Public paste
Undefined
By: hacku | Date: Feb 5 2010 17:24 | Format: PHP | Expires: never | Size: 1.55 KB | Hits: 996

  1. <?php
  2. if ($fls[0] == __FILE__) {
  3. header("Location: index.php");
  4. }
  5. print "<br>Utenti registrati<br><br>";
  6. include("config.php");
  7. if (!isset($_GET['id']) && !isset($_GET['del'])) {
  8.         $query = mysql_query("SELECT id,nick FROM users", $mysql);
  9.         while ($row = mysql_fetch_assoc($query)) {
  10.         print '
  11. <table width="450" bgcolor="black" cellpadding="5" cellspacing="1" border=0>
  12.  
  13.  <tr bgcolor="black">
  14.    <td width="50%"><a href=?page=users&id='.$row['id'].'><kbd>'.htmlspecialchars($row['nick']).'</kbd></a></td>
  15.    <td width="50%"><a title="Elimina Utente" href=?page=users&del='.$row['id'].'><img src='.$wbs.'/images/del.png border=0></a><br></td>
  16.  </tr>
  17. </table>
  18. ';
  19. }
  20. } else if (isset($_GET['id']) && !isset($_GET['del'])) {
  21.         $query = mysql_query("SELECT id,nick,level,password,email FROM users WHERE id='".$_GET['id']."'", $mysql);
  22. $row = mysql_fetch_assoc($query);
  23. print "<font color=red>id:</font> ".$row['id']."<br><font color=red>user:</font> ".htmlspecialchars($row['nick'])."<br><font color=red>Email:</font> ".$row['email']."<br><font color=red>livello:</font>";
  24. if ($row['level']==0 && $row['level'] != null) {
  25. print " Admin Supremo";
  26. } else if ($row['level'] >0) {
  27. print " Utente";
  28. }
  29. print "<br><kbd><font color=red>Password:</font><kbd> ".$row['password'];
  30. print "<br><br><br><a href=?page=users>Back...</a>";
  31. } else if (isset($_GET['del'])) {
  32. if (mysql_query("DELETE from users where id='".$_GET['del']."'", $mysql))
  33. print "Utente eliminato con successo!";
  34. } else {
  35. print "error";
  36. }
  37. print mysql_error();
  38. ?>