Ver Mensaje Individual
  #14 (permalink)  
Antiguo 30/05/2013, 11:18
ambichol
 
Fecha de Ingreso: febrero-2013
Ubicación: Lima
Mensajes: 301
Antigüedad: 11 años, 2 meses
Puntos: 5
Respuesta: Problemas al declarar variable Sesion

consta de 3 archivos:
index
Código PHP:
Ver original
  1. <?php
  2. ?>
  3. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  4. <html xmlns="http://www.w3.org/1999/xhtml">
  5. <head>
  6. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  7. <title>::Web::</title>
  8. <link rel="stylesheet" type="text/css" href="stylesheet.css" />
  9. <script type="text/javascript" src="jquery.js"></script>
  10. <script type="text/javascript" src="functions.ajax.js"></script>
  11. </head>
  12. <body background="Logo2.jpg">
  13.    
  14.     <table border=0 style="position:absolute;top:40px;left:40px;" width=50%>
  15.     <tr>
  16.         <td><img src="logo1.png" /></td>
  17.         <td>
  18.             <div id="logo">            
  19.                 <h2><font color= white>Web de Presupuestos</h2>
  20.                 <p>Bienvenido! Por favor inicie su sesión...</p>
  21.             </div>
  22.         </td>
  23.     </tr>
  24. </table>
  25.    
  26. <div id="allContent">
  27. <table cellpadding="0" cellspacing="0" border="0" height="100%" width="100%">
  28. <tr>
  29. <td align="center" valign="middle" height="100%" width="100%">
  30.     <div id="alertBoxes"></div>
  31.     <span class="loginBlock">
  32.     <span class="inner">
  33.  
  34. <?php
  35.  
  36. if ( isset($_SESSION['username']) && isset($_SESSION['userid']) && $_SESSION['username'] != '' && $_SESSION['userid'] != '0' ){
  37.     echo '<div class="session_on">
  38.         Ya iniciaste sesion, Ahora has un <a href="javascript:void(0);" id="sessionKiller">logout</a>.
  39.         <span class="timer" id="timer"  style="margin-left: 10px;"></span>
  40.     </div>';
  41. }
  42. else{
  43.     echo '<form method="post" action="">
  44.         <table cellpadding="0" cellspacing="0" border="0">
  45.             <tr>
  46.                 <td>Usuario:</td>
  47.                 <td><input type="text" name="login_username" id="login_username" /></td>
  48.             </tr>
  49.             <tr>
  50.                 <td>Contrase&ntilde;a:</td>
  51.                 <td><input type="password" name="login_userpass" id="login_userpass" /></td>
  52.             </tr>
  53.             <tr>
  54.                 <td colspan="2" align="right"><span class="timer" id="timer"></span><button id="login_userbttn">Login</button></td>
  55.             </tr>
  56.         </table>
  57.     </form>';
  58. }
  59.             ?>
  60.        
  61.         </span>
  62.         </span>
  63.        
  64.     </td>
  65.     </tr>
  66.     </table>
  67.     </div>
  68.     </body>
  69. </html>