Ver Mensaje Individual
  #1 (permalink)  
Antiguo 17/08/2010, 17:25
Neon001
 
Fecha de Ingreso: agosto-2010
Mensajes: 5
Antigüedad: 13 años, 8 meses
Puntos: 0
PHP: variables de sesion

MI PROBLEMA ES ESTE: NECESITO LLEVAR EL NOMBRE DEL USUARIO QUE INGRESA AL SISTEMA DESDE QUE INICIA HASTA LA PAGINA QUE TIENE COMO NOMBRE default.php PERO NO SE COMO TOMAR LA VARIABLE DESDE LA CAJA TEXT DE USUARIO.

TENGO 4 ARCHIVOS (indexx.php, control.php, frame_menus.php y default.php)
EL PRIMERO ES MI PAGINA DONDE VERIFICA SI EL USUARIO ESTA EN LA DB CON AYUDA DE control.php

---index.php---
Código PHP:
<html>
<head>
<title>***SiGesProyec***</title>
</head>
<body>
<h2 align="center" style="background-color:skyblue;font-size:150%" ><font color="blue">"Sistema para la Gestion de Proyectos (SiGesProyec)".</h2>
<form action="control.php" method="POST">
<table align="center" width="630" width="291" cellspacing="2" cellpadding="2" border="0">
<tr>
    <td colspan="2" align="center" 
    <?if ($_GET["errorusuario"]=="si"){?>
        bgcolor=yellow><span style="color:fa4c6a"><b>Error en los datos introducidos</b></span>
    <?}else{?>
        bgcolor=#A9F5F2><b>Introduce tus datos de acceso</b>
    <?}?></td>
</tr>
  <tr>
   <td align="center" >&nbsp;</td>
  </tr>
  <tr>
    <td height="100" align="center"><p><b>Usuario:</b>
      <input type="text" name="usuario" maxlength="16" size="20">
    </p>
    <p><b>Contraseña:</b>
      <input type="password" name="password" maxlength="20" size="24">
    </p>
    <p>
     <input type="submit" name="entrar" id="entrar" value="Enviar" />
    </p>
    </td>
  </tr>
</table>
</form>
<br>
</body>
</html>
EL SEGUNDO CONTIENE LA CONEXIÓN Y VERIFICACION DEL USUARIO. SI ESTE EXISTE EL MANDA LA PAGINA DE frame_menus.php

--- control.php ---
Código PHP:
<?php
session_start
();
//conecto con la base de datos
$conn mssql_connect("Wolf","sa","1234") or die ("No conecta con SQLSERVER 2005");
mssql_select_db("sigesproyec",$conn);
$query "SELECT tipo_user,nom_user FROM usuario WHERE nom_user='$usuario' AND password='$password'";
$result mssql_query($query);
//echo $result;
$row mssql_fetch_array($result);
if (
$row["tipo_user"]==1) {header("Location:Administrador/frame_menus.php");exit();}
elseif (
$row["tipo_user"]==2) {header("Location:Usuarios/frame_menusn.php");exit();}
elseif (
$row["tipo_user"]==3) {header("Location:Usuarios/frame_menusn.php");exit();}
else {
header("Location:indexx.php?errorusuario=si");exit();}
mssql_close($conn);
?>
EL TERCERO SOLO ES UNA PAGINA QUE MANEJA 2 FRAMES DENTRO DE ELLA

----- frame_menus.php -----
Código PHP:
<FRAMESET COLS=209,* frameborder="0">
    <
FRAME SRC="menu_admin.php" name="menu_admin" frameborder="0">
        <
FRAMESET ROWS=*>
               <
FRAME SRC="default.php" name="principal_admin" scrolling="auto">
        </
FRAMESET>
</
FRAMESET
Y POR ULTIMO
-------- default.php -------
Código PHP:
<html
<
head
</
head>
<
body>
Usuario : <!--Aqui quiero que me muestre el usuario que ingreso desde el indexx la pagina de acceso-->
</
body>
</
html
SI ALGUIEN PUEDE AYUDAR POR FAVOR SE LOS AGRADECERIA, SI PUEDO MOSTRAR EL USUARIO EN CADA UNA DE LAS PAGINAS SERIA MEJOR PERO YO SIENTO QUE SOLO CON LO PRIMERO ME GUIO.