Created
May 28, 2012 12:22
-
-
Save felipevr/2818870 to your computer and use it in GitHub Desktop.
Sample html/php file
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head><title> Formulário</title></head> | |
<body> | |
<?php | |
if(isset($_POST['enviar'])) { | |
$nome=$_POST["txtNome"]; | |
$tel=$_POST["txtTel"]; | |
$email=$_POST["txtEmail"]; | |
$cid=$_POST["selCid"]; | |
$ass=$_POST["txtAss"]; | |
$sex=isset($_POST["radSex"])?$_POST["radSex"]:''; | |
$mail=$_POST["txtMail"]; | |
$cin=isset($_POST["chkCin"])?$_POST["chkCin"]:''; | |
$esp=isset($_POST["chkEsp"])?$_POST["chkEsp"]:''; | |
//echo var_dump($_POST); | |
echo "<p><strong> Você digitou: </strong><br />"; | |
echo "Nome:$nome<br />"; | |
echo "Telefone: $tel</p>"; | |
} | |
?> | |
<form method="post" action="<?=$_SERVER['PHP_SELF']?>"> | |
<br> Nome Completo:<br> | |
<input type="Text" name="txtNome" size=25 maxlength=25 title="DIGITE SEU NOME" | |
value="<?=isset($nome)?$nome:''?>"> | |
<br> Telefone:<br> | |
<input type="Text" name="txtTel" size='25' maxlength='9' value="<?=isset($tel)?$tel:'9999-9999'?>" | |
title="DIGITE SEU TELEFONE"> | |
<br> Email:<br> | |
<input type="Text" name="txtEmail" size='25' maxlength='50' title="DIGITE | |
SEU EMAIL"> | |
<br>Cidade<br> | |
<select name="selCid"> | |
<option Value="CIDADE">Campo Grande</option> | |
<option Value="CIDADE">Corumbá</option> | |
<option Value="CIDADE">Ponta Porã</option> | |
<option Value="CIDADE">Dourados</option> | |
<option Value="CIDADE">Corguinho</option> | |
</select> | |
<br> Assunto:<br> | |
<input type="Text" name="txtAss" size=25 maxlength=50 > | |
<br> Sexo: | |
<br><input type="Radio" name="radSex" value = "M" >Masculino | |
<br><input type="Radio" name="radSex"value="F">Feminino | |
<br> Sugestão/Duvida:<br> | |
<textarea name="txtMail" rows=5 cols =30 maxlength = 600 > | |
</textarea> | |
<br>Interesses: | |
<br><input type="Checkbox" name="chkCin" value ="Cin">Cinema | |
<br><input type="Checkbox" name="chkEsp" value="Esp"> Esportes | |
<br> | |
<input type="Submit" name="enviar" Value="Enviar"> | |
<input type="Reset" Value="Limpar"> | |
</form> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment