Ver Mensaje Individual
  #5 (permalink)  
Antiguo 24/11/2013, 12:08
Avatar de luisroronoa
luisroronoa
 
Fecha de Ingreso: noviembre-2012
Ubicación: Argentina
Mensajes: 31
Antigüedad: 11 años, 5 meses
Puntos: 0
Sonrisa Respuesta: Como sabe php mis datos

no se que paso pero no cargo mi respuesta -.-
bueno te explico un poco como tengo mi sistema mi BD es esta
luego en el login puse las 2 cajas de texto
Código HTML:
Ver original
  1. <form action="../login_1.php" method="post">
  2.  
  3.                 <input type="text" id="txtUser" name="user" placeholder="Username"/>
  4.                 <p></p>
  5.                 <input type="password" id="txtPassword" name="pw" placeholder="Password"/>
  6.  
  7.  
  8.                 <!-- buttons eye and  -->
  9.                 <button id="botLogIn"></button>
  10.                 <img src="img/eye.png" class="seePass">
  11.  
  12.             </form>
Esas 2 cajas de texto las recibo en un php
Código PHP:
Ver original
  1. <?php
  2. include('./phpfiles/Libreria.php');
  3.  
  4.  $link = conecta();
  5.  
  6.  $sql = "SELECT * FROM usuarios
  7.         WHERE usuario='".$_POST['user']."'
  8.         AND contrasenia='".$_POST['pw']."'  ";
  9.          
  10.  $consulta= mysql_query($sql) or die("ERROR -". mysql_errno());
  11.  $arreglo = mysql_fetch_array($consulta) or die("ERROR -".mysql_errno());
  12.  
  13.  if($arreglo['tipo'] == 1) {
  14.  
  15.    $_SESSION['usuario'] = $arreglo['usuario'];
  16.    header('Location: tabla.php');
  17.    
  18.    // Administrador
  19.    
  20.    }
  21.    
  22.      else {
  23.      
  24.       $_SESSION['usuario'] = $arreglo['usuario'];
  25.       header('Location: usuario.php');
  26.       // Usuario Comun
  27.      
  28.       }
  29.    
  30. ?>
despues si esta correcto lo mando a otro php
Código PHP:
Ver original
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2.  
  3. <html xmlns="http://www.w3.org/1999/xhtml">
  4.  
  5. <head>
  6.  
  7. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  8. <link href="hojalogin.css" type="text/css" rel="stylesheet"></link>
  9.  
  10. <title>ZZZZ</title>
  11. <style type="text/css">
  12. .ll {
  13.     text-align: right;
  14. }
  15. #textfield {
  16.     text-align: center;
  17. }
  18. </style>
  19. </head>
  20.  
  21. <body>
  22.     <?php
  23.  
  24.  
  25.    
  26.  ?>  
  27.     <div width="1000px" align="center">
  28.         <p><img src="utxj_slogan2.png" width="626" height="90" alt="banner" /></p>
  29.    
  30. <p align="center">HOLA </p>
  31. <form><p>Nombre : <input type="text" name="textfield" id="textfield" value="<?php echo $_SESSION['usuario']?>" /> </input>
  32.   <span class="ll" id="textfield">
  33.  Grupo :    
  34.  <input type="text" name="textfield2" id="textfield2" />
  35.  
  36.   <p>Fecha de expedicion :  <?php
  37.         // Establecer la zona horaria predeterminada a usar. Disponible desde PHP 5.1
  38.         date_default_timezone_set('UTC');
  39.         //Imprimimos la fecha actual dandole un formato
  40.         echo date("Y-m-d");
  41.         ?></p>
  42.     <span class="ll" id="textfield">
  43.   <p>Fecha de Inasistencia: <input type="date"></input> </p>
  44.  <p>Dias Justificados : <input></input></p>
  45.   </span>
  46.  
  47.  
  48.   <table  width="500px" height="50px" border="2" align="center"  >    
  49.             <tr>
  50.                 <th>Asignaturas</th>
  51.                 <th>Profesor</th>
  52.                 <th>Seleccione</th>
  53.     <tr>
  54.                      <td >Asignatura</td>
  55.                 <td >Profesor</td>
  56.                 <td ><p align="center"><input type="checkbox" ></input></p></td>
  57.     </tr>
  58.              
  59.                
  60.                
  61.                 <tr><td >Asignatura</td>
  62.                 <td >Profesor</td>
  63.                 <td ><p align="center"><input type="checkbox" ></input></p></td>
  64.                 </tr>
  65.              <tr><td >Asignatura</td>
  66.                 <td >Profesor</td>
  67.                 <td ><p align="center"><input type="checkbox" ></input></p></td>
  68.              </tr>
  69.              <tr><td >Asignatura</td>
  70.                 <td >Profesor</td>
  71.                 <td ><p align="center"><input type="checkbox" ></input></p></td>
  72.              </tr>
  73.                
  74.             </tr>
  75.            
  76.              
  77.              
  78.              
  79.              
  80.   </table>
  81.    
  82.   <p>Motivo :
  83.       <input></input>
  84.   </p>
  85.   <p> Documento anexo : </p>
  86.   <input type="radio" name="group1" value="Receta"> Receta Medica
  87. <input type="radio" name="group1" value="Oficio" checked> Oficio Laboral
  88.         <input type="radio" name="group1" value="Padre" checked> Carta de Padre o Tutor
  89.             <input type="radio" name="group1" value="Otro" checked> Otro<br></br>
  90.   Nota : El presente documento solo será valido dentro de las 48 hrs. hábiles posteriores a su expedición.
  91.   </form>
  92.         </div>  
  93.  
  94. </body>
  95.  
  96. </html>
y el nombre del usuario que inicio sesion lo obtengo con
Código HTML:
Ver original
  1. value="<?php echo $_SESSION['usuario']?>"

despues de eso quiero saber como cargar los demas datos como su nombre REAL porque una cosa es su nombre de usuario y otra es su nombre de alumno entonces ahi fue donde salio mi duda de donde obtengo esos datos ?? si de la consulta del login o de donde ??
intente hacer una consulta a mi BD
Código MySQL:
Ver original
  1. FROM maestro m
  2. INNER JOIN alumno_has_maestro ahm ON m.idmaestro = ahm.idmaestro
  3. INNER JOIN alumno a ON a.idalumnos = ahm.idalumnos
  4. INNER JOIN grupos g ON g.idgrupos = a.idgrupos
  5. WHERE a.matricula =23456
  6. LIMIT 0 , 30
y pues ahí me quede y ya no se como cargar los demas datos tanto como los de la tabla como los de la caja de texto

Última edición por luisroronoa; 24/11/2013 a las 12:17