Ver Mensaje Individual
  #1 (permalink)  
Antiguo 04/10/2014, 10:15
Avatar de ignacio85r
ignacio85r
 
Fecha de Ingreso: mayo-2010
Ubicación: mar del plata
Mensajes: 155
Antigüedad: 13 años, 11 meses
Puntos: 0
Pregunta como seria la construccion correcta?

buenas amigos..
tengo un problema que no me doy cuenta donde esta. quisiera saber si es correcta la construccion del codigo.. ya que al enviar el formulario, me devuelve pagina en blanco...

Código PHP:
?php print
<!
DOCTYPE html>
<
html lang="es">
?> 
Código HTML:
<head>
    <meta charset="UTF-8">
    <title>Recetario Virtual</title>
    <link rel="stylesheet" href="../estilos.css">
</head> 
<body>
Código PHP:
        <?php     
            
if(isset($_POST["enviar"]))    {
            
$link mysqli_connect("localhost""root""""recetario");
            
$sql "INSERT INTO recetas(nombre, autor, receta, fecha)";
            
$sql .= "VALUES('".$_POST["nombre"]."', '".$_POST["autor"]."', '".$_POST["receta"]."')";
            if(
$result mysqli_query($link$sql)) {                                    
            print (
"¡Gracias!, hemos recibido sus datos correctamente.\n");
            } else {print (
$sql mysqli_error($link));}                                
            } else {
        
?>
Código HTML:
<header>        
    </header>
    <nav>
        <ul>
            <li><a href="index.html">Inicio</a></li>
            <li><a href="nosotros.html">Nosotros</a></li>
            <li><a href="contacto.html">Contacto</a></li>
            <li><a href="recetario.html">Recetario</a></li>
        </ul>
        <aside>
            <img src="" alt=""><a href="../index.html">Salir del sistema</a></img>
        </aside>
    </nav>
    <section>
        <nav>
            <a href="acceso.html">Buscar Recetas</a>
            <a href="showall.html">Todas las Recetas</a>
            <a href="addreg.html">Agregar Receta</a>
            <a href="delreg.html">Borrar Receta</a>
            <a href="modreg.html">Modificar Recetas</a>
        </nav>
            <hgroup>
                <h2>Recetario Virtual</h2>
                <h4>¡Almacene sus recetas para no olvidarlas!.</h4>
            </hgroup>
        <form method="post" action="addreg.php">
            <input type="text" name="nombre" placeholder="Nombre de la receta" ><br>
            <input type="text" name="autor" placeholder="Autor"><br>
            <input type="text" name="receta" placeholder="Escribe la Receta"><br>
            <input type="submit" name="Enviar Receta" value="Aceptar informacion"><br>
        </form> 
Código PHP:
        <?php
        
}    
        
?>
Código HTML:
 </section>
    <footer>
        <article><a href="http://">Site Map.</a></article>
        <article><a href="http://">All Rights Reserved.</a></article>
        <article><a href="http://">Faq.</a></article>
    </footer>
</body>    
</html> 
dede ya muchas gracias!
__________________
Los manuales existen por un motivo... explicar el funcionamiento de algo. ;-)