Ir para conteúdo

POWERED BY:

Arquivado

Este tópico foi arquivado e está fechado para novas respostas.

Iury Borges

3 radios botão poblema formulario

Recommended Posts

Gente já pesquisei em tudo que lugar, sobre radio botão de formulario com mais de 3 e da esse erro:

 

Notice: Undefined index: entrega in C:\xampp\htdocs\cadastro\moda\envia.php on line 28

 

Código html:

 

<!doctype html>

<html>
<head>
<meta charset="utf-8">
<title>Moda feminina</title>
<link rel="stylesheet" type="text/css" href="estilo/estilo.css">
</head>
<body>
<table align="center" height="50%" width="50%" border="1">
<tr>
<td>
<img src="img/comprasmulheres.jpg" width="795" height="310" title="Moda feminina">
</td>
</tr>
</table>
<table align="center" height="50%" width="50%" border="0">
<tr>
<td>
<td width="10"><a href="index.html"><img src="img/inicio.png" width="200" height="100" title="Inicio"></td></a>
<td height="100"><a href="moda_feminina.html" title="Moda"><img src="img/moda2.jpg" width="200" height="100"></td></a>
<td height="100"><a href="duvida.html" title="Duvidas"><img src="img/duvidas.jpg" width="200" height="100"></td></a>
<td height="100"><a href="contato.html" title="Contato"><img src="img/contato.jpg" width="200" height="100"></td></a>
</table>
<table align="center">
<tr>
<td align="" valign="middle"><h1>Pagamento debito - referente ao pedido do Short cintura alta risca de giz.</h1>
<form method="post" action="envia.php">
<fieldset><legend>Dados do cliente</legend>
<p align="left">
<label>Nome do cliente:</label>
<input type="text" name="cliente"><br>
<label>Telefone de contato:</label>
<input type="text" name="tel"><br>
<label>E-mail:</label>
<input type="text" name="email"><br>
<label>Rua:</label>
<input type="text" name="rua"><br>
<label>Número</label>
<input type="text" name="numero"><br>
<label>Bairro</label>
<input type="text" name="bairro"><br>
<label>Cep:</label>
<input type="text" name="cep"><br>
</p></fieldset>
</p>
<fieldset><legend>Formas de transporte</legend>
<p>
<label>
<input type="radio" name="entrega" value="normal">
Normal - 6 dias uteis </label>
<br>
<label>
<input type="radio" name="entrega" value="cedex">
Cedex - 3 dias uteis</label>
<br>
<label>
<input type="radio" name="entrega" value="cedex_10" >
Cedex 10 - ate as 10 horas do outro dia</label>
<br>
</p>
</fieldset>
<fieldset><legend>Informação final sobre o produto</legend>
<p align="left">
<label>PP</label>
<input type="checkbox" name="tipo[]" value="p">
<label></label>
<input type="number" name="quantidade1" id="quantidade1"><br><br>
<label>P</label>
<input type="checkbox" name="tipo[]" value="pp">
<label></label>
<input type="number" name="quantidade2"><br><br>
<label>M</label>
<input type="checkbox" name="tipo[]" value="m">
<label></label>
<input type="number" name="quantidade3"><br><br>
<label>G</label>
<input type="checkbox" name="tipo[]" value="g">
<label></label>
<input type="number" name="quantidade4"><br><br>
</p>
<input type="submit" value="Enviar">
</p>
</fieldset>
</form>
</td>
</tr>
</table>
<table align="center" height="50%" width="50%" border="0">
<tr>
<td>
<img src="img/moda-e-estilo-1.jpg" width="795" height="100" title="Moda feminina">
</td>
</tr>
</table>
</body>
</html>
Código php:
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Documento sem título</title>
</head>
<body>
<?php
echo "<h1>Pedido do Short cintura alta risca de giz aguarda o pagamento</h1>";
//referente aos dados do cliente
$cliente=$_POST['cliente'];
$telefone_de_contato=$_POST['tel'];
$email=$_POST['email'];
$rua=$_POST['rua'];
$numero=$_POST['numero'];
$bairro=$_POST['bairro'];
$cep=$_POST['cep'];
//referente a forma de transporte
$entrega=$_POST['entrega'];
//referente a informação sobre o produto quantidade
$quantidade1=$_POST['quantidade1'];
$quantidade2=$_POST['quantidade2'];
$quantidade3=$_POST['quantidade3'];
$quantidade4=$_POST['quantidade4'];
echo "<h1>Dado do cliente:</h1>";
echo "Nome do(a) cliente: ".$cliente."<br>";
echo "Telefone: ".$telefone_de_contato."<br>";
echo "E-mail: ".$email."<br>";
echo "Rua: ".$rua."<br>";
echo "Número: ".$numero."<br>";
echo "Bairro: ".$bairro;
echo "<br>Cep: ".$cep;
echo "<h1>Tipo:</h1>";
if(isset($_POST['tipo']))//verifica se a variavel existe
{
echo "O tipo do short é<br>";
{
foreach($_POST['tipo'] as $tipo)
echo " ".$tipo;
}
}
else
{
echo "não seleciono nehum tipo<br><br>";
}
echo "<h1>Qunatidade:</h1>";
if($quantidade1 > 0)
echo "A quantidade de produtos é $quantidade1<br>";
else
echo "";
if($quantidade2 > 0)
echo "A quantidade de produtos é $quantidade2<br>";
else
echo "";
if($quantidade3 > 0)
echo "A quantidade de produtos é $quantidade3<br>";
else
echo "";
if($quantidade4 > 0)
echo "A quantidade de produtos é $quantidade4<br>";
else
echo "";
echo "<h1>Forma de entrega</h1>";
echo $entrega;
?>
</body>
</html>

 

Compartilhar este post


Link para o post
Compartilhar em outros sites

×

Informação importante

Ao usar o fórum, você concorda com nossos Termos e condições.