Ver Mensaje Individual
  #10 (permalink)  
Antiguo 22/11/2011, 14:51
Avatar de memp500
memp500
 
Fecha de Ingreso: octubre-2011
Ubicación: venezuela
Mensajes: 40
Antigüedad: 12 años, 6 meses
Puntos: 0
Respuesta: inicio de sesion

Error:
Código HTML:
Ver original
  1. Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at /home/sidarco/public_html/intranet/cover/header.php:4) in /home/sidarco/public_html/intranet/sec/inicio.php on line 2
  2.  
  3. Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/sidarco/public_html/intranet/cover/header.php:4) in /home/sidarco/public_html/intranet/sec/inicio.php on line 2

Codigo:
INICIO.PHP
Código PHP:
Ver original
  1. <?php
  2. require_once('Connections/config.php'); ?>
  3. <?php
  4. if (!function_exists("GetSQLValueString")) {
  5. function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
  6. {
  7.   if (PHP_VERSION < 6) {
  8.     $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
  9.   }
  10.  
  11.   $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
  12.  
  13.   switch ($theType) {
  14.     case "text":
  15.       $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
  16.       break;    
  17.     case "long":
  18.     case "int":
  19.       $theValue = ($theValue != "") ? intval($theValue) : "NULL";
  20.       break;
  21.     case "double":
  22.       $theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
  23.       break;
  24.     case "date":
  25.       $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
  26.       break;
  27.     case "defined":
  28.       $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
  29.       break;
  30.   }
  31.   return $theValue;
  32. }
  33. }
  34.  
  35. mysql_select_db($database_config, $config);
  36. $query_Recordset1 = "SELECT * FROM FT_USUARIOS";
  37. $Recordset1 = mysql_query($query_Recordset1, $config) or die(mysql_error());
  38. $row_Recordset1 = mysql_fetch_assoc($Recordset1);
  39. $totalRows_Recordset1 = mysql_num_rows($Recordset1);
  40.  
  41. $colname_Recordset2 = "-1";
  42. if (isset($_SESSION['MM_username'])) {
  43.   $colname_Recordset2 = $_SESSION['MM_username'];
  44. }
  45. mysql_select_db($database_config, $config);
  46. $query_Recordset2 = sprintf("SELECT usuario FROM FT_USUARIOS WHERE usuario = %s", GetSQLValueString($colname_Recordset2, "text"));
  47. $Recordset2 = mysql_query($query_Recordset2, $config) or die(mysql_error());
  48. $row_Recordset2 = mysql_fetch_assoc($Recordset2);
  49. $totalRows_Recordset2 = mysql_num_rows($Recordset2);
  50. ?>
  51. <?php
  52.     // *** Validate request to login to this site.
  53.     if (!isset($_SESSION)) {
  54.     }
  55.  
  56. $loginFormAction = $_SERVER['PHP_SELF'];
  57. if (isset($_GET['accesscheck'])) {
  58.   $_SESSION['PrevUrl'] = $_GET['accesscheck'];
  59. }
  60.  
  61. if (isset($_POST['usuario'])) {
  62.   $loginUsername=$_POST['usuario'];
  63.   $password=$_POST['pass'];
  64.   $MM_fldUserAuthorization = "";
  65.   $MM_redirectLoginSuccess = "index.php?seccion=welcome";
  66.   $MM_redirectLoginFailed = "index.php?seccion=falleuser";
  67.   $MM_redirecttoReferrer = false;
  68.   mysql_select_db($database_config, $config);
  69.  
  70.   $LoginRS__query=sprintf("SELECT id_cliente, primer_apellido FROM ft_clientes WHERE id_cliente=%s AND primer_apellido=%s",
  71.     GetSQLValueString($loginUsername, "int"), GetSQLValueString($password, "text"));
  72.    
  73.   $LoginRS = mysql_query($LoginRS__query, $config) or die(mysql_error());
  74.   $loginFoundUser = mysql_num_rows($LoginRS);
  75.   if ($loginFoundUser) {
  76.      $loginStrGroup = "";
  77.    
  78.     //declare two session variables and assign them
  79.     $_SESSION['MM_Username'] = $loginUsername;
  80.     $_SESSION['MM_UserGroup'] = $loginStrGroup;      
  81.  
  82.     if (isset($_SESSION['PrevUrl']) && false) {
  83.       $MM_redirectLoginSuccess = $_SESSION['PrevUrl']; 
  84.     }
  85.     header("Location: " . $MM_redirectLoginSuccess );
  86.   }
  87.   else {
  88.     header("Location: ". $MM_redirectLoginFailed );
  89.   }
  90. }
  91. ?>
  92. <div id="content-box">
  93.         <div class="padding">
  94.             <div class="login" id="element-box">
  95.                 <div class="t">
  96.                     <div class="t">
  97.                         <div class="t"></div>
  98.                     </div>
  99.                 </div>
  100.                 <div class="m">
  101.  
  102.                     <h1>Ingreso de Usuarios Registrados</h1>
  103.                    
  104.                             <div id="section-box">
  105.             <div class="t">
  106.                 <div class="t">
  107.                     <div class="t"></div>
  108.                 </div>
  109.             </div>
  110.             <div class="m">
  111.                 <form ACTION="<?php echo $loginFormAction; ?>" style="clear: both;" id="form-login" name="login" method="POST">
  112.     <p id="form-login-username">
  113.         <label for="modlgn_username">Usuario</label>
  114.         <input type="text" size="15" class="inputbox" id="modlgn_username" name="usuario">
  115.     </p>
  116.  
  117.     <p id="form-login-password">
  118.         <label for="modlgn_passwd">Contraseña</label>
  119.         <input type="password" size="15" class="inputbox" id="modlgn_passwd" name="pass">
  120.     </p>
  121.         <p style="clear: both;" id="form-login-lang">
  122.        
  123.     <div class="button_holder">
  124.     <div class="button1">
  125.         <div class="next">
  126.             <a onclick="login.submit();">
  127.                 Entrar</a>
  128.  
  129.         </div>
  130.     </div>
  131.     </div>
  132.     <div class="clr"></div>
  133.     <input type="submit" value="Entrar" style="border: 0; padding: 0; margin: 0; width: 0px; height: 0px;">
  134.    
  135.    
  136.     </form>
  137. <div class="clr"></div>
  138.             </div>
  139. <div class="b">
  140.                 <div class="b">
  141.                     <div class="b"></div>
  142.                 </div>
  143.             </div>
  144.         </div>
  145.        
  146.                     <p>Ingresa un nombre de usuario y contraseña validos para acceder al Sistema.</p>
  147.                     <p>
  148.                         <a href="javascript:history.back(1)">Regresar a la Pagina Anterior</a>
  149.                     </p>
  150.                     <div id="lock"></div>
  151.                     <div class="clr"></div>
  152.                 </div>
  153.     <div class="h_green" id="border-top">
  154.         <div>
  155.             <div>
  156.                 <div class="adminform">Insurance Broker Sistem By ARTEM LABS, CA</div>
  157.             </div>
  158.         </div>
  159.     </div>
  160.                 <div class="b">
  161.                     <div class="b">
  162.                         <div class="b"></div>
  163.                     </div>
  164.                 </div>
  165.             </div>
  166.                         <div class="clr"></div>
  167.         </div>
  168. </div>
  169.     <div id="border-bottom"><div><div></div></div>
  170. </div>
  171. </body><?php
  172. mysql_free_result($Recordset1);
  173.  
  174. mysql_free_result($Recordset2);
  175. ?>
__________________
crear soluciones y oportunidades de desarrollo y crecimiento