Advertisement
Guest User

Untitled

a guest
Jun 20th, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.50 KB | None | 0 0
  1. <?php
  2. if (isset($_POST['enviar'])) {
  3. $nom = $_POST['nome'];
  4. $fone = $_POST['tel'];
  5. $cp = $_POST['cpf'];
  6. $quebra = chr(13).chr(10);
  7. if ($file = fopen("cli/clientes.txt", "a+")) {
  8. fputs($file, "$nom;$fone;$cp;$quebra");
  9. fclose($file);
  10. header("Location: ind.html");
  11. } else {
  12. header("Location: ind.html?
  13. msg=Erro fatal");
  14. }
  15. }
  16.  
  17. if (isset($_POST['enviar'])) {
  18. $endereco = $_POST['end'];
  19. $valor = $_POST['val'];
  20. $situacao = $_POST['sit'];
  21. $quebra = chr(13).chr(10);
  22. if ($file = fopen("imo/imoveis.txt", "a+")) {
  23. fputs($file, "$endereco;$valor;$situacao;$quebra");
  24. fclose($file);
  25. header("Location: ind.html");
  26. } else {
  27. header("Location: ind.html?
  28. msg=Erro fatal");
  29. }
  30.  
  31. }
  32. if(isset($_POST['enviarr'])){
  33. echo "<strong>LISTA DE CLIENTES</strong> <br>";
  34. $arq = fopen("cli/clientes.txt", "r");
  35. while (!feof($arq)){
  36. $str = fgets($arq);
  37. echo $str;
  38. echo "<br>";
  39. }
  40. fclose($arq);
  41. }
  42. echo "<strong>LISTA DE IMOVEIS</strong> <br>";
  43. $arq = fopen("imo/imoveis.txt", "r");
  44. while (!feof($arq)){
  45. $str = fgets($arq);
  46. echo $str;
  47. echo "<br>";
  48. }
  49. fclose($arq);
  50.  
  51. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement