diff --git a/aula15v2.php b/aula15v2.php new file mode 100644 index 0000000..ffc3423 --- /dev/null +++ b/aula15v2.php @@ -0,0 +1,181 @@ + + + + + + + Aula 11 + +

Atividade texto

+ +
+
+ + + + + + + + +
CADASTRO!
Nome:
Documento:
Telefone:
Curso: +
+


+ +
+ + +
+ + + + + + + +
VER NOMES CADASTRADOS
Curso:
Nome:
Registro:
+
+ Resgistro: $registro $nome Documento: $doc Telefone: $tel foi cadastrado no curso $curso

"; + $texto = "

Resgistro: $registro $nome Documento: $doc Telefone: $tel foi cadastrado no curso $curso

"; + + $arquivo = "reg.txt"; + $fp = fopen($arquivo, "w"); + fwrite($fp, $registro); + fclose($fp); + + $arquivo = $nome.".txt"; + $fp = fopen($arquivo, "w"); + fwrite($fp, $texto); + fclose($fp); + + $arquivo = $curso.".txt"; + $fp = fopen($arquivo, "a"); + fwrite($fp, $texto); + fclose($fp); + + $arquivo = $registro.".txt"; + $fp = fopen($arquivo, "w"); + fwrite($fp, $texto); + fclose($fp); + }else{ + if($nome != null or $doc != null or $tel != null or $curso != null){ + echo"

Preencha todos os campos para cadastrar!

"; + } + } + + if($cursoc != null){ + $arquivo = $cursoc.".txt"; + if(@$fp = fopen($arquivo, "r")){ + $contents = fread($fp, filesize($arquivo)); + fclose($fp); + echo"$contents"; + } + + } + + if($nomec != null){ + $arquivo = $nomec.".txt"; + if(@$fp = fopen($arquivo, "r")){ + $contents = fread($fp, filesize($arquivo)); + fclose($fp); + echo"$contents"; + }else{ + echo"

Nome não encontrado!

"; + } + + } + + if($reg != null){ + $arquivo = $reg.".txt"; + if(@$fp = fopen($arquivo, "r")){ + $contents = fread($fp, filesize($arquivo)); + fclose($fp); + echo"$contents"; + }else{ + echo"

Registro não encontrado!

"; + } + + } + + + ?> +
+ + + \ No newline at end of file