Tema: php y html5
Ver Mensaje Individual
  #1 (permalink)  
Antiguo 25/12/2015, 12:53
anachanelblanc
 
Fecha de Ingreso: marzo-2014
Ubicación: Galicia
Mensajes: 24
Antigüedad: 10 años, 2 meses
Puntos: 0
Pregunta php y html5

hola, no soy programadora, solo aficionada. Tengo un archivo en php, le he puesto algun div para darle css al archivo. Pero para etiquetarlo en html5 no tengo claro si es obligatorio el <header> y el <footer>dentro del <body>, o si solo poner una section con varios articles, ¿ que etiquetas tengo que poner para maquetarlo en html5? gracias de antemano
Código PHP:
Ver original
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <title>PROCESAR</title>
  4. <head>
  5. <style type="text/css">
  6. body{
  7.     background-image:url("imagenes/tecnologia.jpg");
  8. }
  9. #registrado,#fallos,#existe{background:black;
  10. height:200px;
  11. color:red;
  12. margin:100px 400px 100px;
  13. height:150px;
  14. width:35%;
  15. font-size:20px;
  16. padding-top:15px;
  17. }
  18.  
  19. </style>
  20.  
  21. </head>
  22. <body>
  23. <?php
  24. include("conexion.php");
  25. if(isset($_POST['usuario']) && preg_match("/^[a-z]{3,10}$/",($_POST['usuario']))&&
  26. isset($_POST['email'])&& $email=filter_input(INPUT_POST, 'email', FILTER_VALIDATE_EMAIL)){
  27. $usuario=$_POST['usuario'];
  28. $email=$_POST['email'];
  29. $conexion=conectarse();
  30. $sql='SELECT * FROM inscripcion WHERE email="'.$email.'"';
  31. $resultado=$conexion->query($sql);                          
  32. if($resultado->num_rows>0){
  33.  echo'<div id="existe">El Email ya existe,introduce otro</div>';
  34.  echo '<div id="registrado" style=display:none>';
  35.  echo '<div id="fallos" style=display:none>';
  36.  echo'<meta http-equiv="Refresh" content="5; URL=http://localhost:8888/prueba/porculo.html">';
  37.         }else{
  38.              $sql='INSERT INTO inscripcion(usuario, email,estado)values ("'.$usuario.'","'.$email.'","desactivado")';
  39.  
  40.               $resultado=$conexion->query($sql);
  41.                 if($resultado){
  42.                 echo'<div id="registrado">Usuario Registrado. Recibiras un email de verificacion en tu correo</div>';
  43.                 echo'<div id="fallos" style=display:none>';
  44.                  echo '<div id="existe" style=display:none>';
  45.                 echo'<meta http-equiv="Refresh" content="7;URL=http://localhost:8888/prueba/porculo.html">';
  46.                                
  47.          
  48.             $para=$_POST['email'];
  49.             $asunto="Confirmación de Subscripción al Blog ";
  50.             $mensaje="<html lang='es'>
  51.                      <head>
  52.                      <title>Link de Activación de subscripción al Blog </title>
  53.                      <meta charset='UTF-8'/>
  54.                      </head>
  55.                      <body>
  56.                      Gracias por subscribirte a mi Blog. Haz click en el siguiente enlace para confirmar la subscripción
  57.                      <a href='http://xxxx/verificar.php?email=$email'>Activar</a>
  58.                      </body>
  59.                      </html>";
  60.  
  61.             $cabeceras="MIME-Version: 1.0" . "\r\n";
  62.             $cabeceras.= "Content-type:text/html;charset=UTF-8" . "\r\n";
  63.  
  64.             $cabeceras.=" From: <[email protected]" ."\r\n";
  65.  
  66.            mail($para,$asunto,$mensaje,$cabeceras);
  67.          
  68.  
  69.         }
  70.     }
  71.     }
  72.  ?>
  73.  <div id="fallos"> 
  74.  <?php
  75.  
  76. $errores=array();
  77. if(!preg_match("/^[a-z]{3,10}$/",$_POST['usuario'])){
  78. echo $errores[]= "Tu nombre, debe contener como mínimo 3 letras"."<br><br/>";
  79. }
  80. if($email=!filter_input(INPUT_POST, 'email', FILTER_VALIDATE_EMAIL)){
  81. echo $errores[]="Email incorrecto";  
  82. echo'<meta http-equiv="Refresh" content="5; URL=http://localhost:8888/prueba/porculo.html">';
  83.  
  84.  }
  85.  ?>
  86.  </div>
  87. </body>
  88. </html>