Esto sigue sin funcionar. Os pongo el código completo del archivo nuevo_plato.php. Gracias.
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Administración Cafetería Tonik</title>
<link href="estilos.css" rel="stylesheet" type="text/css">
<style type="text/css">
#apDiv1 {
position: absolute;
width: 422px;
height: 316px;
z-index: 1;
left: 321px;
top: 148px;
border-top-width: thin;
border-right-width: thin;
border-bottom-width: thin;
border-left-width: thin;
border-top-style: solid;
border-right-style: solid;
border-bottom-style: solid;
border-left-style: solid;
box-shadow: 5px 5px 5px #3333CC;
}
#apDiv2 {
position: absolute;
width: 405px;
height: 274px;
z-index: 2;
left: 332px;
top: 160px;
border-top-style: none;
border-right-style: none;
border-bottom-style: none;
border-left-style: none;
border-top-width: thin;
border-right-width: thin;
border-bottom-width: thin;
border-left-width: thin;
}
label {
font-family:"Times New Roman", Times, serif;
font-size:18px;
}
input {
background-color:#039;
color:#FFF;
width:250px;
height:20px;
font-family:"Times New Roman", Times, serif;
font-size:18px;
}
textarea {
background-color:#039;
color:#FFF;
width:370px;
font-family:"Times New Roman", Times, serif;
font-size:18px;
}
#precio {
background-color:#039;
color:#FFF;
width:50px;
height:20px;
font-family:"Times New Roman", Times, serif;
font-size:18px;
}
#btn_entrar {
background-color:#666;
color:#000;
width: 80px;
height: 40px;
cursor:pointer;
color:#FFF;
text-shadow: rgb(0,0,150) 3px 3px 5px;
font-family:"Times New Roman", Times, serif;
font-size:20px;
}
body {
background: -webkit-linear-gradient(20deg, #FFF, #03F);
background: -moz-linear-gradient(20deg, #FFF, #03F);
background: -o-linear-gradient(20deg, #FFF, #03F);
background: linear-gradient(20deg, #FFF, #03F);
}
#apDiv3 {
position: absolute;
width: 690px;
height: 115px;
z-index: 3;
left: 233px;
top: 5px;
text-align:center;
font-family:"Times New Roman", Times, serif;
font-size:36px;
color:#FFF;
text-shadow: rgb(0,0,150) 3px 3px 3px;
}
</style>
</head>
Código PHP:
Ver original<?php
include ("../cafeteria_tonik_conexion.php");
if (isset($_GET['id_mio'])) {
$identificador = $_GET['id_mio'];
echo $identificador;
}
if(isset($_POST['btn_entrar'])) {
$titulo = $_POST['titulo'];
$plato = $_POST['plato'];
$precio = $_POST['precio'];
{
echo "<script language='JavaScript'>
alert('Debes introducir un plato');
document.location=('nuevo_plato.php');
</script>";
header('Location: nuevo_plato.php'); }
{
echo "<script language='JavaScript'>
alert('Debes introducir un precio para este plato');
document.location=('nuevo_plato.php');
</script>";
header('Location: nuevo_plato.php'); }
}
?>
<body>
<div id="apDiv1"></div>
<div id="apDiv2">
<form method="post" action="nuevo_plato.php">
<p>
<label for="titulo">Título del plato:</label>
<input name="titulo" type="text" id="titulo">
</p>
<p>
<label for="plato">Plato:</label>
</p>
<p>
<textarea name="plato" rows="4" cols="60"></textarea>
</p>
<p>
<label for="precio">Precio del plato:</label>
<input type="number" name="precio" id="precio" class="precio" step="any">
</p>
<p align="center">
<input id="btn_entrar" type="submit" value="Guardar" name="btn_entrar">
</p>
</form>
</div>
<div id="DivLogo">Cafetería Tonik Administración</div>
</body>
</html>