Ver Mensaje Individual
  #5 (permalink)  
Antiguo 21/12/2010, 18:42
future89
 
Fecha de Ingreso: diciembre-2010
Mensajes: 106
Antigüedad: 13 años, 5 meses
Puntos: 10
Respuesta: como recuperar el rut de una sesion iniciada

si al iniciar sesion usuario , cree la variable $_SESSION["rut"]= $f['rut']; entonces podria
quedar asI?

Código PHP:
Ver original
  1. if(isset ($_POST["Reservar"]) && $_POST["Reservar"]=="Reservar")
  2. {
  3.  
  4.  
  5. $id_reserva=$_POST["id_reser"];
  6.    // la persona ya inicio sesion con nombre_usuario y password
  7.                           //, como recuperar el rut de esa persona
  8. //para gurdar el rut en la tabla reserva
  9.                          
  10. $_SESSION["rut"]= $f['rut'];
  11. $id_mesa=$_POST["id_mesa"];
  12.  
  13.  
  14. $fecha_juego=$_POST["fecha_juego"];
  15. $hora_inicio=$_POST["hora_inicio"];
  16. $hora_fin=$_POST["hora_fin"];
  17.  
  18. $hora_reser= time(h:i);
  19. $fecha    = date("j-m-Y");
  20.  
  21.  
  22.  
  23.  $sql="INSERT INTO reserva (id_reser,rut,id_mesa,fecha_reser,hora_reser,concretada,fecha_juego,hora_inicio,hora_fin) VALUES
  24. ('$id_reserva','$_SESSION\['rut']\','$id_mesa','$fecha','$hora_reser','','$fecha_juego','$hora_inicio','$hora_fin ') ";
  25.  
  26.  
  27.   @mysql_query($sql,$conexion) or die(mysql_error());
  28.  
  29. }
  30. ?>