rendered paste body<?echo"<meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'>";echo "<form method=\"POST\" action=\"gaaaa.php\"><input type='text' name='txt_nome' size='80'><br><input type='text' name='txt_nome1' size='80'> <input type=\"submit\" name=\"btnOK\" value=\"save\"></form>";?><? unlink("aaaa.txt"); //PEGA OS DADOS ENVIADOS PELO FORMULRIO $nome = $_POST["txt_nome"]; $nome1 = $_POST["txt_nome1"]; //PREPARA O CONTEDO A SER GRAVADO $conteudo = "\r\n"; $conteudo = "text=$nome&text2=$nome1\r\n"; //ARQUIVO TXT $arquivo = "aaaa.txt"; //TENTA ABRIR O ARQUIVO TXT if (!$abrir = fopen($arquivo, "a")) { echo "Error opening file ($arquivo)"; exit; } //ESCREVE NO ARQUIVO TXT if (!fwrite($abrir, $conteudo)) { print "Error writing file ($arquivo)"; exit; } echo"<meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'>"; echo "File text:"; echo " . <a href='javascript:history.go(-1)'>back</a>"; echo "<br>"; $myFile = "aaaa.txt"; $fh = fopen($myFile, 'r'); $theData = fread($fh, 100); fclose($fh); $mostra = substr($nome,0,100); echo ($mostra); echo "<br>"; $mostra2 = substr($nome1,0,100); echo ($mostra2); //FECHA O ARQUIVO fclose($abrir);?>