Advertisement
Guest User

deletar.php

a guest
May 24th, 2012
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.85 KB | None | 0 0
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <?php
  5.  
  6. $conexao = mysql_connect('localhost', 'root', '3630207')
  7. or die('Erro ao conectar com o bando de dados!');
  8. $db = mysql_select_db('informacoes')
  9. or die('Erro ao selecionar o banco de dados!');
  10.  
  11. ?>
  12. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  13. <title>Exibir dados</title>
  14. </head>
  15.  
  16. <body>
  17. <?php
  18. $usuario = $_POST['usuario'];
  19. $deleta = mysql_query("DELETE FROM informacoes WHERE usuario = '$usuario'");
  20.  
  21. if($deleta == ''){
  22. echo 'Erro ao deletar usuário!';
  23. }else{
  24. echo 'Usuário deletado com sucesso!';
  25. }
  26.  
  27. ?>
  28. <form action="index.php">
  29. <input type="submit" value="Voltar" name="Voltar" />
  30. </form>
  31. </body>
  32. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement