Public paste
Undefined
By: Guest | Date: Feb 5 2010 17:03 | Format: PHP | Expires: never | Size: 657 B | Hits: 481

  1. <?php
  2.  
  3. include ("../../config.php");
  4. include ("../admin.php");
  5.  
  6. $connect = mysql_connect("$host_db", "$user_db", "$pass_db");
  7. mysql_select_db("$nome_db", $connect);
  8.  
  9. $utenti = mysql_query("SELECT * FROM nixutenti");
  10. $n = 0;
  11.  
  12. while ($buffer = mysql_fetch_array($utenti))
  13. {
  14.         $n = $n + 1;   
  15.         $nome = $buffer['username'];
  16.         echo "[".$n."]"." ".$nome ." ";
  17.         $id = $buffer['id'];
  18.         echo "<a href='index.php?action=delete&id=$id'>Cancella</a><br>";
  19.        
  20. }
  21.  
  22. if ($_GET['action'] == "delete" && isset($_GET['id']))
  23. {
  24.         $id = $_GET['id'];
  25.         echo $id;
  26.         $delete = "DELETE FROM nixutenti WHERE id='".$_GET['id']."'";
  27.         $res = mysql_query($delete);
  28. }
  29. ?>
Latest pastes
1 days ago
7 days ago
19 days ago
24 days ago
26 days ago