
Cannot POST /Formulario/registro.php
Publicado por Andrea Diaz (2 intervenciones) el 15/02/2022 16:02:12
Buenos días a todos, estoy teniendo un problema con mi base de datos y no se por qué sucede, solo necesito guardar los datos en una base pero me sale este error (Cannot POST /Formulario/registro.php)
el código html es el siguiente:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<link rel="stylesheet" type="text/css" href="css/style.css">
<title>Formulario Nemónico</title>
</head>
<body>
<div id="content">
<h1>Crear nemónico</h1>
<form action="registro.php" method="POST">
<table border="1">
<tr>
<td><label>Nemónico</label></td>
<td><input type="text" name="nemonicouser" placeholder="nemonico" required/></td>
</tr>
<tr>
<td><label>Programa</label></td>
<td><input type="text" name="aprogramauser" placeholder="programa" required/></td>
</tr>
<tr>
<td><label>Detalle</label></td>
<td><input type="text" name="detalleuser" placeholder="detalle" required/></td>
</tr>
<tr>
<td><label><input type="submit" value="Generar"></input></label></td>
<td><label><input type="reset" value="Limpiar"></input></label></td>
</tr>
</form>
</div>
</body>
</html>
y el código php es este:
<?php
$link = mysql_connect("localhost","root","") or die("<h2>No se encuentra el servidor</h2>");
$db = mysql_select_db("formulario",$link) or die("<h2>Error de Conexion</h2>");
$nemonico = $_POST['nemonicouser'];
$programa = $_POST['aprogramauser'];
$detalle = $_POST['detalleuser'];
$req = (strlen($nemonico)*strlen($programa)*strlen($detalle)*strlen) or die("No se han llenado todos los campos");
mysql_query("INSERT INTO datos VALUES('$nemonico','$programa','$detalle','$link') or die("<h2>Error Guardando los datos</h2>");
echo'
<script>
alert("Registro Exitoso");
location.href="index.html";
</script>
'
?>
si me pueden colaborar encontrando el error se lo agradecería enormemente.
el código html es el siguiente:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<link rel="stylesheet" type="text/css" href="css/style.css">
<title>Formulario Nemónico</title>
</head>
<body>
<div id="content">
<h1>Crear nemónico</h1>
<form action="registro.php" method="POST">
<table border="1">
<tr>
<td><label>Nemónico</label></td>
<td><input type="text" name="nemonicouser" placeholder="nemonico" required/></td>
</tr>
<tr>
<td><label>Programa</label></td>
<td><input type="text" name="aprogramauser" placeholder="programa" required/></td>
</tr>
<tr>
<td><label>Detalle</label></td>
<td><input type="text" name="detalleuser" placeholder="detalle" required/></td>
</tr>
<tr>
<td><label><input type="submit" value="Generar"></input></label></td>
<td><label><input type="reset" value="Limpiar"></input></label></td>
</tr>
</form>
</div>
</body>
</html>
y el código php es este:
<?php
$link = mysql_connect("localhost","root","") or die("<h2>No se encuentra el servidor</h2>");
$db = mysql_select_db("formulario",$link) or die("<h2>Error de Conexion</h2>");
$nemonico = $_POST['nemonicouser'];
$programa = $_POST['aprogramauser'];
$detalle = $_POST['detalleuser'];
$req = (strlen($nemonico)*strlen($programa)*strlen($detalle)*strlen) or die("No se han llenado todos los campos");
mysql_query("INSERT INTO datos VALUES('$nemonico','$programa','$detalle','$link') or die("<h2>Error Guardando los datos</h2>");
echo'
<script>
alert("Registro Exitoso");
location.href="index.html";
</script>
'
?>
si me pueden colaborar encontrando el error se lo agradecería enormemente.
Valora esta pregunta


0