Created
October 19, 2023 19:59
-
-
Save DDOrozco17/345517bbcbd298f8c0ef366f437b57db to your computer and use it in GitHub Desktop.
bd formulario
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<title>Document</title> | |
</head> | |
<body> | |
<form action="productos.php" method="post"> | |
Formulario datos de productos<br> | |
Apellido Paterno: <input type="text" name="txtap"><br> | |
Apellido Materno: <input type="text" name="txtam"><br> | |
Nombre: <input type="text" name="txtnombre"><br> | |
<input type="submit" value="Enviar"> | |
</form> | |
</body> | |
</html> |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<title>Document</title> | |
</head> | |
<body> | |
<?php | |
echo "Diego Diaz Orozco <br>"; | |
echo "Obtener datos del formulario index.php 5J "; | |
$con = mysqli_connect("localhost", "root", "", "bdpapeleria_ddo"); | |
$txtap = $_POST['txtap']; | |
$txtam = $_POST['txtam']; | |
$txtnombre = $_POST['txtnombre']; | |
// database insert SQL code | |
$sql = "INSERT INTO tbl_productos (id, ap, am, nombre) VALUES (0, '$txtap', '$txtam', '$txtnombre')"; | |
// insert in database | |
$rs = mysqli_query($con, $sql); | |
if ($rs) { | |
echo "<br> Se insertaron los datos"; | |
} | |
?> | |
</body> | |
</html> |
Author
DDOrozco17
commented
Oct 19, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment