Pregunta simple, variables PHP
Publicado por Lucas (46 intervenciones) el 24/04/2020 21:55:31
Hola, disculpen,alguien podría indicarme por que no me reconoce las variables que utilicé? Use esta misma sintaxis en otros documentos parecidos y si funcionan.
Este es el documento del formulario:
Y este el PHP:

Este es el documento del formulario:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Formulario</title>
</head>
<body>
<from method="post" action="formulario.php">
<div class="comunes">
<label for="fecha">Fecha</label>>
<input type="date" name="fecha">
<label for="lote">Lote</label>
<input name="lote" type="text">
</div>
<div class="cuerpo">
<label for="nombre">Nombre<input type="text" name="nombre"></label>
<input type="number" name="elemento1">
<input type="number" name="elemento2">
<input type="number" name="elemento3">
<div class="suma">
<?php
include("formulario.php");
echo "$suma";
?>
</div>
<input type="submit" value="Listo" name="listo">
</div>
</div>
</from>
</body>
</html>
Y este el PHP:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
<?php
include("bases de datos/base_datos.php");
$conexion=mysqli_connect($dbd,$ubd,$cbd,$nbd);
mysqli_set_charset($conexion,"UTF-8");
$nombre=$_POST["nombre"];
$fecha=$_POST["fecha"];
$elemento1=$_POST["elemento1"];
$elemento2=$_POST["elemento2"];
$elemento3=$_POST["elemento3"];
$lote=$_POST["lote"];
$suma=$elemento1+$elemento2+$elemento3;
?>

Valora esta pregunta


0