Advertisement
Guest User

Script_do_Formulario.php

a guest
Feb 7th, 2016
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.43 KB | None | 0 0
  1. <?php
  2.     function salva_arquivo($key, $value) {
  3.         $arquivo = "banco.txt";
  4.         $data = $key." : ".$value."\n";
  5.         $f = fopen($arquivo, 'a+');
  6.         fwrite($f, $data);
  7.         fclose($f);
  8.     }
  9.     $fields = array('email', 'sobrenome', 'dia', 'mes', 'ano', 'rg', 'cpf', 'cpf2', 'rua', 'numero','bairro','estado','cidade','cep');
  10.    
  11.     foreach($_POST as $key=>$value) {
  12.         if(!in_array($key, $fields))
  13.             break;
  14.        
  15.         salva_arquivo($key, $value);
  16.        
  17.     }
  18. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement