Foros del Web » Programando para Internet » PHP »

Un pequeño problema con el default

Estas en el tema de Un pequeño problema con el default en el foro de PHP en Foros del Web. Hola,miren todos,hize un simple login,muy básico,pero eficiente como para que el usuario haga sesion.El problema es que yo quiero que una vez que haga login,se ...
  #1 (permalink)  
Antiguo 05/06/2005, 08:56
Saldu
Invitado
 
Mensajes: n/a
Puntos:
Exclamación Un pequeño problema con el default

Hola,miren todos,hize un simple login,muy básico,pero eficiente como para que el usuario haga sesion.El problema es que yo quiero que una vez que haga login,se cargue al default.php,que contiene esto:

<FRAMESET COLS="*,745,*" FRAMEBORDER="0" BORDER="0">
<FRAME NAME="Blanco" SRC="blanco.html" scrolling="no">

<frameset rows="98,*" frameborder="NO" border="0" framespacing="0" marginwidth="0" marginheight="0">
<frame src="frame.php" scrolling="NO" noresize>

<frameset cols="150,*" frameborder="NO" border="0" framespacing="0">
<?php
if(isset($_SESSION["username"]) && ($_SESSION["user_password"])>0){
?>
<frame src="menu.php?" scrolling="NO" noresize>
<?php }else{?>
<frame src="frame2.php" scrolling="NO" noresize>
<?php }?>


<frameset rows="*,84" frameborder="YES" border="0" framespacing="0">
<?php
if(isset($_SESSION["username"]) && ($_SESSION["user_password"])>0){
?>
<frame src="noticias/index.php" scrolling="NO" noresize>
<?php }else{?>
<frame src="index.php" name="mainFrame" noresize>
<?php }?>
<frame src="frame3.php" name="bottomFrame" noresize>
scrolling="NO">


</frameset>


Cómo verán,lo que yo quiero hacer es que si reconoce la máquina,que el usuario inició una sesión,osea,pasó correctamente por el sistema de login,se le cargué en vez del frame2.php,el menu.php(frame izquierdo)...y lo mismo con el mainframe(el del medio,el principal digamos) si es un visitante no registrado que se le cargue el index.php pero si el usuario inició sesión,está registrado,que se le cargue el "noticias/index.php"...
A todo esto,cada vez que hago login,no me hace caso,y directamente me carga todo como un usuario desconocido...
Me ayudan con esto? gracias,muchisimas gracias
  #2 (permalink)  
Antiguo 05/06/2005, 10:56
 
Fecha de Ingreso: diciembre-2003
Mensajes: 213
Antigüedad: 20 años, 4 meses
Puntos: 0
No se si esta linea te esta funcionando bien o no, pero desde luego no es muy correcta:

if(isset($_SESSION["username"]) && ($_SESSION["user_password"])>0){

Mas bien sería asi:

if( isset($_SESSION["username"]) && isset($_SESSION["user_password"]) ){
  #3 (permalink)  
Antiguo 05/06/2005, 12:56
Saldu
Invitado
 
Mensajes: n/a
Puntos:
correjí ese error,y sigue sin reaccionar... les muestro todo el default.php si quieren:

<?PHP
session_start();
?>
<html>
<head>


<style type="text/css">
<!--
body {
SCROLLBAR-FACE-COLOR:#6699CC;
SCROLLBAR-HIGHLIGHT-COLOR: #6699CC;
SCROLLBAR-SHADOW-COLOR: #6699CC;
SCROLLBAR-3DLIGHT-COLOR: #FFFFFF;
SCROLLBAR-ARROW-COLOR: #FFFFFF;
SCROLLBAR-TRACK-COLOR: #E3E3E3;
SCROLLBAR-DARKSHADOW-COLOR: #000000;
}
-->
</style>


<FRAMESET COLS="*,745,*" FRAMEBORDER="0" BORDER="0">
<FRAME NAME="Blanco" SRC="blanco.html" scrolling="no">

<frameset rows="98,*" frameborder="NO" border="0" framespacing="0" marginwidth="0" marginheight="0">
<frame src="frame.php" scrolling="NO" noresize>

<frameset cols="150,*" frameborder="NO" border="0" framespacing="0">
<?php
if( isset($_SESSION["username"]) && isset($_SESSION["user_password"]) ){
?>
<frame src="menu.php?" scrolling="NO" noresize>
<?php }else{?>
<frame src="frame2.php" scrolling="NO" noresize>
<?php }?>


<frameset rows="*,84" frameborder="YES" border="0" framespacing="0">
<?php
if( isset($_SESSION["username"]) && isset($_SESSION["user_password"]) ){
?>
<frame src="noticias/index.php" scrolling="NO" noresize>
<?php }else{?>
<frame src="index.php" name="mainFrame" noresize>
<?php }?>
<frame src="frame3.php" name="bottomFrame" noresize>
scrolling="NO">
</frameset>
</head>
</html>
  #4 (permalink)  
Antiguo 10/06/2005, 00:39
Avatar de jam1138
/** @package Moderador */
 
Fecha de Ingreso: julio-2004
Ubicación: sèveR led onieR lE
Mensajes: 9.368
Antigüedad: 19 años, 8 meses
Puntos: 102
Supongo te abrás asegurado haces una correcta asignación a tus variables de sesión y las recibes correctamente...

Por otra parte, ya te lo había dicho!!!, ¿para qué condicionar a 2 variables???... si tu loguin está bien hecho con una sobra y basta (ilumina código):
Código PHP:
<?PHP
session_start
();
?>
<html>
<head>


<style type="text/css">
<!--
body {
SCROLLBAR-FACE-COLOR:#6699CC;
SCROLLBAR-HIGHLIGHT-COLOR: #6699CC;
SCROLLBAR-SHADOW-COLOR: #6699CC;
SCROLLBAR-3DLIGHT-COLOR: #FFFFFF;
SCROLLBAR-ARROW-COLOR: #FFFFFF;
SCROLLBAR-TRACK-COLOR: #E3E3E3;
SCROLLBAR-DARKSHADOW-COLOR: #000000;
}
-->
</style>


<FRAMESET COLS="*,745,*" FRAMEBORDER="0" BORDER="0">
<FRAME NAME="Blanco" SRC="blanco.html" scrolling="no">

<frameset rows="98,*" frameborder="NO" border="0" framespacing="0" marginwidth="0" marginheight="0">
<frame src="frame.php" scrolling="NO" noresize>

<frameset cols="150,*" frameborder="NO" border="0" framespacing="0">
<?php
if(isset($_SESSION["username"])){
?>
<frame src="menu.php?" scrolling="NO" noresize>
<?php
} else {
?>
<frame src="frame2.php" scrolling="NO" noresize>
<?php
}
?>


<frameset rows="*,84" frameborder="YES" border="0" framespacing="0">
<?php
if( isset($_SESSION["username"])) {
?>
<frame src="noticias/index.php" scrolling="NO" noresize>
<?php
} else {
?>
<frame src="index.php" name="mainFrame" noresize>
<?php
 
}
?>
<frame src="frame3.php" name="bottomFrame" noresize>
scrolling="NO">
</frameset>
</head>
</html>
__________________
٩(͡๏̯͡๏)۶
» Cómo hacer preguntas de manera inteligente «

"100 años después, la revolución no es con armas, es intelectual y digital"
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 00:14.