Share Pastebin
Guest
Public paste!

comentarios.php

By: a guest | Mar 21st, 2010 | Syntax: PHP | Size: 0.99 KB | Hits: 103 | Expires: Never
Copy text to clipboard
  1. <?php
  2. //Conexão com MySQL
  3. $conexao = mysql_connect("localhost", "root", "");
  4. $banco = mysql_select_db("mural");
  5. // Fim
  6.  
  7. ?>
  8. <form name="form" method="post" action="file:///C|/Arquivos de programas/EasyPHP5.3.0/www/recados/enviar_comentarios.php">
  9. Nome: <input type="text" name="nome">
  10. <br/>
  11. <br/>
  12. E-mail: <input type="text" name="email">
  13. <br/>
  14. <br/>
  15. Mensagem: <textarea name="mensagem"></textarea>
  16. <br/>
  17. <br/>
  18. <input type="submit" value=Enviar recado>
  19. </form>
  20.  
  21. <?
  22. echo "<h1>Mural de recados</h1>";
  23. echo "<br/>";
  24. //Lista os comentários do banco de dados MySQL
  25. $sql = "select * from recados order by id desc";
  26. $executar = mysql_query($sql);
  27. while ($exibir = mysql_fetch_array($executar)){;
  28. echo "<strong>Nome: <strong>".$exibir['nome'];
  29. echo "<br/>";
  30. echo "<strong>E-mail: <strong>".$exibir['email'];
  31. echo "<br/>";
  32. echo "<strong>Data: <strong>".$exibir['data'];
  33. echo "<br/>";
  34. echo "<strong>Mensagem: <strong>".$exibir['mensagem'];
  35. echo "<br/>";
  36. echo "<br/>";
  37. echo "<br/>";
  38. }
  39. ?>