Foros del Web » Programando para Internet » PHP »

No se porque no va al index

Estas en el tema de No se porque no va al index en el foro de PHP en Foros del Web. Hola a todos, tengo un problema, cuando quiero validar un formulario y algo es incorrecto me sale sin los estilos sin nada... dejo el link ...
  #1 (permalink)  
Antiguo 25/09/2015, 17:44
Avatar de fedefrankk  
Fecha de Ingreso: agosto-2007
Mensajes: 871
Antigüedad: 16 años, 8 meses
Puntos: 7
Pregunta No se porque no va al index

Hola a todos, tengo un problema, cuando quiero validar un formulario y algo es incorrecto me sale sin los estilos sin nada...

dejo el link para que vean el errror, llenen todo y la suma la ponen mal y vean...

http://www.unimevonline.com/nuevo/in...ex.php?page=1B


aca image de los directorios:




dejo codigo:

formulario de inicio de sesion

Código PHP:
Ver original
  1. <!doctype html>
  2. <html>
  3. <head>
  4.  
  5. </head>
  6. <style>
  7. form{ float:left; margin-left:300px; width:500px; height:auto; margin-top:50px;}
  8. label {
  9.   display: inline-block;
  10.   width: 80px;
  11. }
  12. input#email{
  13.     margin:20px; /* BAJA DE ARRIABA HACIA ABAJO 20PX */
  14.     width:300px; /* LARGO DEL INPUT*/
  15.     height:30PX; /* ALTURA DEL INPUT*/
  16.     padding-left:10px; /*SEPARA EL TEXTO 10PX DENTRO DEL INPUT */
  17.     outline-color:#6BBFF1; /* COLOR DEL BORDE DEL INPUT COMO SE VE AL CARGAR LA WEB */
  18.     border:1px solid #C9CBCA;/* DEFINE EL COLOR DE LA LINEAS DEL INPUT*/
  19.     -webkit- border-radius: 4px; /* DEFINE LOS BORDES REDONDEADOS */
  20.     border-radius: 4px;
  21.     -webkit- box-shadow: 0px 0px 4px #B6B6B6; /* DEFINE SOMBRA */
  22.     box-shadow:0px 0px 4px #B6B6B6;
  23.     -webkit-transition: width .5s;
  24.     transition: width .5s;
  25.     }
  26.  
  27. input#email:focus{
  28.     width:350px; /* ALARGA EL INPUT A 350PX CON EL FOCUS */
  29.     border:1px solid #C9CBCA;/* DEFINE EL COLOR DE LA LINEAS DEL INPUT*/
  30.     }
  31. /***************************************/
  32. input#text{
  33.     margin:20px; /* BAJA DE ARRIABA HACIA ABAJO 20PX */
  34.     width:300px; /* LARGO DEL INPUT*/
  35.     height:30PX; /* ALTURA DEL INPUT*/
  36.     padding-left:10px; /*SEPARA EL TEXTO 10PX DENTRO DEL INPUT */
  37.     outline-color:#6BBFF1; /* COLOR DEL BORDE DEL INPUT COMO SE VE AL CARGAR LA WEB */
  38.     border:1px solid #C9CBCA;/* DEFINE EL COLOR DE LA LINEAS DEL INPUT*/
  39.     -webkit- border-radius: 4px; /* DEFINE LOS BORDES REDONDEADOS */
  40.     border-radius: 4px;
  41.     -webkit- box-shadow: 0px 0px 4px #B6B6B6; /* DEFINE SOMBRA */
  42.     box-shadow:0px 0px 4px #B6B6B6;
  43.     -webkit-transition: width .5s;
  44.     transition: width .5s;
  45.     }
  46.  
  47. input#text:focus{
  48.     width:350px; /* ALARGA EL INPUT A 350PX CON EL FOCUS */
  49.     border:1px solid #C9CBCA;/* DEFINE EL COLOR DE LA LINEAS DEL INPUT*/
  50.     }
  51.  
  52. input#boton{ margin-left:150px; padding:5px 50px; margin-top:50px; cursor:pointer;
  53. color:#FFFFFF;
  54. font-size:1em;
  55. background-color:#5DADE2;
  56.     -webkit-transition:background-color .25s;
  57.     transition:background-color .25s;
  58. border: 0px;
  59. -webkit- border-radius: 5px; /* DEFINE LOS BORDES REDONDEADOS */
  60. border-radius: 5px;
  61. -webkit- box-shadow: 0px 4px 0px #4AA4DF; /* DEFINE SOMBRA */
  62. box-shadow:0px 4px 0px #4AA4DF;
  63.  
  64. }
  65. input#boton:hover{
  66.     background-color:#7ABBE7;
  67.    
  68. }
  69.  
  70. .n1{ border:hidden; width:30px; margin:5px 5px 5px 15px; background-color:#F6F7CF}
  71.  
  72. .a1{margin-top:50px; margin-left:100px;}
  73. </style>
  74. <?php
  75. $num1 = mt_rand(1,8);
  76. $num2 = mt_rand(1,8);
  77. $suma = $num1+ $num2;
  78.  
  79.  
  80. $veo_1="none";
  81.  
  82. if (isset($_GET['cata'])) {
  83.  
  84. switch ($_GET['cata']) {
  85.     case 1:
  86.         $veo_1="block";
  87.         break;
  88.     case 2000:
  89.         $As2="block";
  90.         break;
  91.     case 3000:
  92.         $As3="block";
  93.         break;
  94. }
  95.    
  96. }
  97. ?>
  98.  
  99.  
  100. <form action="../regusuraios/scripvalidar.php" method="post" />
  101. <label for="email">Email:</label>
  102. <input type="email"  id="email" name="email" placeholder="Escriba su email">
  103.  
  104. <label for="text">Contraseña:</label>
  105. <input type="text"  id="text" name="pass" placeholder="Su contraseña">
  106.  
  107.  
  108. <p>Ingrese el resultado de la suma.</p>
  109.  
  110. <input class="n1" type="text" name="num1" readonly value="<?php echo $num1 ?>"> + <input class="n1" type="text" name="num2" readonly value="<?php echo $num2 ?>"><br>
  111.  
  112. <p> Total </p>
  113. <input class="n2" type="text" name="total_suma" ><br>
  114. <input class="n3"  type="hidden" name="sumatotal" value="<?php echo $suma ?>" />
  115.  
  116. <label><input type="submit" value="enviar" id="boton"></label>
  117. <div class="a1" style="display:<?php echo $veo_1 ?>">
  118.  
  119. <?php echo "La suma de los numeros ". $num1 ." y " .$num2 ." es incorrecta" ?>  
  120.  
  121.  
  122. </div>
  123. </form>
  124.  
  125. </body>
  126. </html>


donde valida y vuelve si hay error

Código PHP:
Ver original
  1. <?php
  2. //$uri   = $_SERVER['PHP_SELF'];
  3. //$host  = $_SERVER['HTTP_HOST'];
  4. $email_1=$_POST['email'];
  5. $pass_1= $_POST['pass'];
  6. $sumaca= $_POST['total_suma'];
  7. $sumare= $_POST['sumatotal'];
  8.  
  9.  
  10.  
  11. if ($sumaca<>$sumare){
  12.    
  13.     //echo "LA SUMA ES INCORRECTA ";
  14.    
  15.     header("Location:formusuarioA.php?cata=1");
  16.     }else{
  17.        
  18.         echo "la suma es correcta";
  19.         }
  20.  
  21. ?>

este es el index.php

Código PHP:
Ver original
  1. <a href="index.php"  title="fefe"><div class="unimevlogo"></div></a>
  2. <div class="cuadrado">dentro</div> <?php // CUADRO CONTENEDOR DE NOTICIAS ?>
  3. <div class="info"><?php // CUADRO DE INFORMACION */
  4.  
  5. echo "Bienvenido:<br>";
  6. echo "Vistas:<br>"
  7.  
  8.  
  9. ?>
  10.  
  11.  
  12.  
  13.  
  14. </div>
  15.  
  16.  
  17. <!-- begin navigation -->
  18.     <nav id="navigation">
  19.         <ul>
  20.             <li><a href="index.php">Inicio</a></li>
  21.             <li><a href="#">Services</a></li>
  22.             <li><a href="#">Portfolio</a></li>
  23.             <li><a href="#">About</a></li>
  24.             <li><a href="index.php?page=1B">Iniciar sesion</a></li>
  25.             <li><a href="index.php?page=1C">Contacto</a></li>
  26.            
  27.         </ul>
  28.     </nav>
  29.     <!-- end navigation -->
  30.  
  31. <?php
  32. if (empty($_GET)) {
  33.  
  34. include_once('../index/galeria.php');
  35.  
  36.  
  37. //    header("Location:../index.php?page=1&dsdsd=3000");
  38. }else{
  39. //<li class="idli hajajaja"><a href="index.php?page=1" style="text-decoration:none;visibility:Ingresar</a></li>//
  40. switch($_GET['page']){
  41.  
  42.  
  43.  
  44. case "1A":
  45. include_once('../we_reg_usuario/form_inicio_usuario.php');
  46. break;
  47.  
  48.  
  49. case "1B":
  50. echo "<div class='formusuario'>";
  51. include_once('../regusuraios/formusuarioA.php');
  52. echo "</div>";
  53. break;
  54.  
  55.  
  56. case "1C":
  57. echo "<div class='contacto'>";
  58. include_once("../contacto/formContacto.php");
  59. echo "</div>";
  60. break;
  61. }
  62. }
  63.  
  64. ?>
  65.  
  66.  
  67. </div> <!-- fin de toda la web -->
  68. </body>
  69. </html>

Se agradece cada aporte y mucha gracias de antemano
saludos
fede
  #2 (permalink)  
Antiguo 25/09/2015, 23:48
 
Fecha de Ingreso: septiembre-2015
Ubicación: Madrid
Mensajes: 5
Antigüedad: 8 años, 7 meses
Puntos: 0
Respuesta: No se porque no va al index

Cuando hay algun error veo que estas redirigiendo la pagina a "formusuarioA.php".
Intenta redirigirlo a la misma pagina del formulario.

header("Location:index.php?cata=1");
  #3 (permalink)  
Antiguo 26/09/2015, 10:47
Avatar de fedefrankk  
Fecha de Ingreso: agosto-2007
Mensajes: 871
Antigüedad: 16 años, 8 meses
Puntos: 7
Pregunta Respuesta: No se porque no va al index

Hola Gracias por responder, cata=1 lo direcciono ne nuevo al formulario porque me devolvio un error.. si lo mando al index, tendria que validar el error hay dentro...seria muy engorrozo...

No se si es buena practica ponerle a todas las paginas el include, con el encabezado en este mismo encabezado poner los botones etc...

Me he cansado y no encuentro como hacer un index...

Muchas gracias por tu ayuda.
saludos
fede

Etiquetas: formulario, html, index
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 14:38.