Foros del Web » Programando para Internet » PHP »

inicio de sesion

Estas en el tema de inicio de sesion en el foro de PHP en Foros del Web. la linea que dices debe ir asi: mysql_select_db($database_config, $config); solo que no me habia metico co eso de eccho esa consulta la habia borrado te ...

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

la linea que dices debe ir asi:

mysql_select_db($database_config, $config);

solo que no me habia metico co eso de eccho esa consulta la habia borrado te paso el codigo nuevo:

<?php require_once('../../../Connections/config.php'); ?>
<?php
if (!isset($_SESSION)) {
session_start();
}
$MM_authorizedUsers = "";
$MM_donotCheckaccess = "true";

// *** Restrict Access To Page: Grant or deny access to this page
function isAuthorized($strUsers, $strGroups, $UserName, $UserGroup) {
// For security, start by assuming the visitor is NOT authorized.
$isValid = False;

// When a visitor has logged into this site, the Session variable MM_Username set equal to their username.
// Therefore, we know that a user is NOT logged in if that Session variable is blank.
if (!empty($UserName)) {
// Besides being logged in, you may restrict access to only certain users based on an ID established when they login.
// Parse the strings into arrays.
$arrUsers = Explode(",", $strUsers);
$arrGroups = Explode(",", $strGroups);
if (in_array($UserName, $arrUsers)) {
$isValid = true;
}
// Or, you may restrict access to only certain users based on their username.
if (in_array($UserGroup, $arrGroups)) {
$isValid = true;
}
if (($strUsers == "") && true) {
$isValid = true;
}
}
return $isValid;
}

$MM_restrictGoTo = "index.php";
if (!((isset($_SESSION['MM_Username'])) && (isAuthorized("",$MM_authorizedUsers, $_SESSION['MM_Username'], $_SESSION['MM_UserGroup'])))) {
$MM_qsChar = "?";
$MM_referrer = $_SERVER['PHP_SELF'];
if (strpos($MM_restrictGoTo, "?")) $MM_qsChar = "&";
if (isset($QUERY_STRING) && strlen($QUERY_STRING) > 0)
$MM_referrer .= "?" . $QUERY_STRING;
$MM_restrictGoTo = $MM_restrictGoTo. $MM_qsChar . "accesscheck=" . urlencode($MM_referrer);
header("Location: ". $MM_restrictGoTo);
exit;
}
?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
if (PHP_VERSION < 6) {
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
}

$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);

switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
}

mysql_select_db($database_config, $config);
$query_Recordset1 = "SELECT * FROM ft_usuarios";
$Recordset1 = mysql_query($query_Recordset1, $config) or die(mysql_error());
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
$totalRows_Recordset1 = mysql_num_rows($Recordset1);
?>
<table width="auto" border="0" cellspacing="0">
<tr>
<td><table width="auto" border="0" cellspacing="0">
<tr>
<td><table width="auto" border="0" cellspacing="0">
<tr>
<td><img src="http://www.forosdelweb.com/images/icono_usuario.png" width="25" height="26"/></td>
<td> <?php if(empty($_SESSION['MM_Username']))
{
echo "Ingrese al Sistema";}
else echo "Bienvenido ".$_SESSION['MM_Username'] ;?></td>
</tr>
</table>
</td>
</tr>
<tr>
<td><center><a href="index.php?seccion=welcome">Desconectar</a>
</center></td>
</tr>
</table>
</td>
</tr>
</table>
<?php
mysql_free_result($Recordset1);
?>
__________________
crear soluciones y oportunidades de desarrollo y crecimiento
  #62 (permalink)  
Antiguo 26/11/2011, 12:16
webankenovi
Invitado
 
Mensajes: n/a
Puntos:
Respuesta: inicio de sesion

ahora si tienen valor espera q mire este code y te cuento mas
  #63 (permalink)  
Antiguo 26/11/2011, 12:22
webankenovi
Invitado
 
Mensajes: n/a
Puntos:
Respuesta: inicio de sesion

borra esto de user_mod.php

<?php require_once('../../../Connections/config.php'); ?>
<?php
if (!isset($_SESSION)) {
session_start();
}

y seguimos
  #64 (permalink)  
Antiguo 26/11/2011, 12:24
webankenovi
Invitado
 
Mensajes: n/a
Puntos:
Respuesta: inicio de sesion

y borra esto de welcome.php

if (!isset($_SESSION)) {
session_start();
}
  #65 (permalink)  
Antiguo 26/11/2011, 12:24
webankenovi
Invitado
 
Mensajes: n/a
Puntos:
Respuesta: inicio de sesion

dime el footer por si acaso
  #66 (permalink)  
Antiguo 26/11/2011, 12:26
Avatar de memp500  
Fecha de Ingreso: octubre-2011
Ubicación: venezuela
Mensajes: 40
Antigüedad: 12 años, 6 meses
Puntos: 0
Respuesta: inicio de sesion

footer solo tiene lo siguiente:

</body>
</html>
__________________
crear soluciones y oportunidades de desarrollo y crecimiento
  #67 (permalink)  
Antiguo 26/11/2011, 12:28
webankenovi
Invitado
 
Mensajes: n/a
Puntos:
Respuesta: inicio de sesion

pues entnces este es tu codigo

Código PHP:
Ver original
  1. <?php
  2. if (!file_exists('Connections/config.php')){
  3.    
  4.     header('Location: install.php');
  5.    
  6.     } else {
  7.        
  8.     require_once('Connections/config.php');
  9.    
  10.     }
  11.  
  12.     include_once('cover/header.php'); ?>
  13.  
  14.     <div id="marco">
  15.     <div id="header">
  16.     <div id="logo">
  17.     <div id="menu"><?php include('modulos/mod_menu/menu.php'); ?></div>
  18.     </div>
  19.     </div>
  20.     <div id="contenido">
  21.     <div id="sidebar"><?php include_once ('cover/sidebar.php'); ?></div>
  22.     <div id="conten"><?php include_once ('cover/sistem.php'); ?></div>
  23.     </div>
  24.     <div id="footframe">
  25.     <div id="time"><?php include_once ('modulos/mod_reloj/reloj.php'); ?></div>
  26.     <div id="footer"><?php include_once  ('cover/copyr.php'); ?></div>
  27.     </div>
  28.     </div>
  29.     <?php include_once ('cover/footer.php'); ?>

y borra

Código PHP:
Ver original
  1. if (!isset($_SESSION)) {
  2. }

de welcome.php

y borra

Código PHP:
Ver original
  1. require_once('../../../Connections/config.php'); ?>
  2. <?php
  3. if (!isset($_SESSION)) {
  4. }

de user_mod.php

y me cuentas , lo q pasa q e visto que lo hacen con dreamweaver y el te genera el codgio y entnces te duplica el session_start() en todas las paginas el config con requerir una vez es suficiente
  #68 (permalink)  
Antiguo 26/11/2011, 12:44
Avatar de memp500  
Fecha de Ingreso: octubre-2011
Ubicación: venezuela
Mensajes: 40
Antigüedad: 12 años, 6 meses
Puntos: 0
Respuesta: inicio de sesion

lo mismo

inicio aparece bien sin errores

pero al entrar con usuario y clave existente no redirige a welcome y reporta el siguiente error:

Warning: Cannot modify header information - headers already sent by (output started at /home/sidarco/public_html/intranet/nuevo/cover/header.php:5) in /home/sidarco/public_html/intranet/nuevo/sec/inicio.php on line 78
__________________
crear soluciones y oportunidades de desarrollo y crecimiento
  #69 (permalink)  
Antiguo 26/11/2011, 12:46
webankenovi
Invitado
 
Mensajes: n/a
Puntos:
Respuesta: inicio de sesion

no e entrado en detalles de los scripts solo en la sesion_start y includes dime la linea 78 la q falla
  #70 (permalink)  
Antiguo 26/11/2011, 12:46
Avatar de memp500  
Fecha de Ingreso: octubre-2011
Ubicación: venezuela
Mensajes: 40
Antigüedad: 12 años, 6 meses
Puntos: 0
Respuesta: inicio de sesion

pero el problema es el header el include del header en el index, ya que lo quito y no reporta error!!!!!!!!!!!!!!!!!!!!!!!!!

por eso preguntaba como lo ordeno????
__________________
crear soluciones y oportunidades de desarrollo y crecimiento
  #71 (permalink)  
Antiguo 26/11/2011, 12:51
Avatar de memp500  
Fecha de Ingreso: octubre-2011
Ubicación: venezuela
Mensajes: 40
Antigüedad: 12 años, 6 meses
Puntos: 0
Respuesta: inicio de sesion

esta es la linea 78 en inicio.php

header("Location: " . $MM_redirectLoginSuccess );

y esta es la linea 5 en header.php:

<meta name="description" content="

osea lo que me da el error es que el header esta imprimiendo html antes del codigo como header locatin y por eso creo que sale el error:

por eso mi pregunta como ordenar si lo que esta dentro de header se supone debe ir de primero
__________________
crear soluciones y oportunidades de desarrollo y crecimiento
  #72 (permalink)  
Antiguo 26/11/2011, 12:53
Avatar de memp500  
Fecha de Ingreso: octubre-2011
Ubicación: venezuela
Mensajes: 40
Antigüedad: 12 años, 6 meses
Puntos: 0
Respuesta: inicio de sesion

otra solucion que veo es llamando a dos archivos al mismo tiempo es decir

cuando llame a inicio.php tambien llame al inicio_codigo.php donde inicio.php tendra el html y donde inicio_codigo.php tendra el codigo php y sql y todo.

pero no se como hacerlo
__________________
crear soluciones y oportunidades de desarrollo y crecimiento
  #73 (permalink)  
Antiguo 26/11/2011, 12:54
webankenovi
Invitado
 
Mensajes: n/a
Puntos:
Respuesta: inicio de sesion

pero el header debe de ir ay y ay esta bien puesto haciendo los cambios que yo te dije para no tener conflictos con session_start() q lo tenias repetido 3 veces y en diferentes sitios

el problema esta en el script por algo q no sabemos q entra en conflicto con algo ati te falla el header xq falla algo dentro de esa pagina que a su vez falla en el inicio.php sabes lo que te digo , x eso si lo kitas no falla pero alguna funcion q iciste o algo fallara y no te ara lo que kieres , o no te registra o lo q sea

reporta la linea 78 de inicio.php y deja todo como yo te dije reviso la linea y te cuento

alomejor si vas a tener q separar codigo pero sin saber q linea falla no te lo puedo decir
  #74 (permalink)  
Antiguo 26/11/2011, 12:57
webankenovi
Invitado
 
Mensajes: n/a
Puntos:
Respuesta: inicio de sesion

espera q revise
  #75 (permalink)  
Antiguo 26/11/2011, 13:04
webankenovi
Invitado
 
Mensajes: n/a
Puntos:
Respuesta: inicio de sesion

una cosa no puede ser q te redirija todo el rato a la misma pagina la linea 78 q entre en un bucle de redireccion??

o prueba separando codigo como dices , x ahora no doy con el problema
  #76 (permalink)  
Antiguo 26/11/2011, 13:06
Avatar de memp500  
Fecha de Ingreso: octubre-2011
Ubicación: venezuela
Mensajes: 40
Antigüedad: 12 años, 6 meses
Puntos: 0
Respuesta: inicio de sesion

creo que si es por que el header esta antes de header location por hay ley que antes de session start o header location no debe haber ningun tipo de html o echo o print.

por eso creo que la solucion seria la siguiente manera

index.php:

Código PHP:
Ver original
  1. <?php
  2.     session_start();
  3.     if (!file_exists('Connections/config.php')){
  4.        
  5.         header('Location: install.php');
  6.        
  7.         } else {
  8.            
  9.         require_once('Connections/config.php');
  10.        
  11.         }
  12.     [COLOR="Red"] // aqui colocar algo asi como:
  13. include "inicio_codigo.php" si es que estan llamando a inicio.php si no es php llamar al que es algo asi.[/COLOR]
  14.  
  15.  
  16.         include_once('cover/header.php'); ?>
  17.      
  18.         <div id="marco">
  19.         <div id="header">
  20.         <div id="logo">
  21.         <div id="menu"><?php include('modulos/mod_menu/menu.php'); ?></div>
  22.         </div>
  23.         </div>
  24.         <div id="contenido">
  25.         <div id="sidebar"><?php include_once ('cover/sidebar.php'); ?></div>
  26.         <div id="conten"><?php include_once ('cover/sistem.php'); ?></div> [COLOR="Red"]/// aqui solo llama a inicio.php que es donde esta el codigo html solamente[/COLOR]
  27.         </div>
  28.         <div id="footframe">
  29.         <div id="time"><?php include_once ('modulos/mod_reloj/reloj.php'); ?></div>
  30.         <div id="footer"><?php include_once  ('cover/copyr.php'); ?></div>
  31.         </div>
  32.         </div>
  33.         <?php include_once ('cover/footer.php'); ?>

no se si se puede hacer algo asi????
__________________
crear soluciones y oportunidades de desarrollo y crecimiento
  #77 (permalink)  
Antiguo 26/11/2011, 13:09
Avatar de memp500  
Fecha de Ingreso: octubre-2011
Ubicación: venezuela
Mensajes: 40
Antigüedad: 12 años, 6 meses
Puntos: 0
Respuesta: inicio de sesion

o como hacer para que llame por ejemplo a inicio_codigo.php y a inicio.php y cuando requiera ir a buscar como llamar a buscar_codigo.php y a buscar.php al mismo tiempo es lo no se como hacer
__________________
crear soluciones y oportunidades de desarrollo y crecimiento
  #78 (permalink)  
Antiguo 26/11/2011, 13:11
webankenovi
Invitado
 
Mensajes: n/a
Puntos:
Respuesta: inicio de sesion

este es tu menu

Código PHP:
Ver original
  1. <table width="100%" border="0" cellspacing="0">
  2.       <tr>
  3.         <td><a href="index.php?seccion=welcome">Inicio</a></td>
  4.         <td><a href="index.php?seccion=ingresar">Ingresar</td>
  5.         <td><? include("user_mod.php");?></td>
  6.       </tr>
  7.     </table>

kita el include y incluyelo antes del header

Código HTML:
Ver original
  1. <table width="100%" border="0" cellspacing="0">
  2.       <tr>
  3.         <td><a href="index.php?seccion=welcome">Inicio</a></td>
  4.         <td><a href="index.php?seccion=ingresar">Ingresar</td>
  5.         <td>[COLOR="Red"]y aki llamas a una variable para mostrar lo q desees[/COLOR]</td>
  6.       </tr>
  7.     </table>


Código PHP:
Ver original
  1. <?php
  2.         session_start();
  3.         if (!file_exists('Connections/config.php')){
  4.            
  5.             header('Location: install.php');
  6.            
  7.             } else {
  8.                
  9.             require_once('Connections/config.php');
  10.            
  11.             }
  12.         //////////// aqui colocar algo asi como:
  13.     include "USER_MOD.php
  14.    
  15.    
  16.            include_once('cover/header.php'); ?>
  17.          
  18.             <div id="marco">
  19.             <div id="header">
  20.             <div id="logo">
  21.             <div id="menu"><?php include('modulos/mod_menu/menu.php'); ?></div>
  22.             </div>
  23.             </div>
  24.             <div id="contenido">
  25.             <div id="sidebar"><?php include_once ('cover/sidebar.php'); ?></div>
  26.             <div id="conten"><?php include_once ('cover/sistem.php'); ?></div> [COLOR="Red"]/// aqui solo llama a inicio.php que es donde esta el codigo html solamente[/COLOR]
  27.             </div>
  28.             <div id="footframe">
  29.             <div id="time"><?php include_once ('modulos/mod_reloj/reloj.php'); ?></div>
  30.             <div id="footer"><?php include_once  ('cover/copyr.php'); ?></div>
  31.             </div>
  32.             </div>
  33.             <?php include_once ('cover/footer.php'); ?>



Y ESTOS ECHOS Q ACES EN USER_MOD LOS LLAMAS EN MENU

echo "Ingrese al Sistema";}
else echo "Bienvenido ".$_SESSION['MM_Username'] ;?></td>

ES DECIR ESTO SEPARADO DE USER_MOD ESTO EN MENU,PHP

echo "Ingrese al Sistema";}
else echo "Bienvenido ".$_SESSION['MM_Username'] ;?></td>
</tr>
</table>
</td>
</tr>
<tr>
<td><center><a href="index.php?seccion=welcome">Desconectar</a>
</center></td>
</tr>
</table>
</td>
</tr>
</table>
  #79 (permalink)  
Antiguo 26/11/2011, 13:15
webankenovi
Invitado
 
Mensajes: n/a
Puntos:
Respuesta: inicio de sesion

Si no sabes como te lo hago en un momento
  #80 (permalink)  
Antiguo 26/11/2011, 13:24
Avatar de memp500  
Fecha de Ingreso: octubre-2011
Ubicación: venezuela
Mensajes: 40
Antigüedad: 12 años, 6 meses
Puntos: 0
Respuesta: inicio de sesion

si ayudame con eso de variables que no entiendo mucho y de verdad disculpa la molestia y de paso explicame eso del karma a ver si te dejo algo de eso tambien jejejejej
__________________
crear soluciones y oportunidades de desarrollo y crecimiento
  #81 (permalink)  
Antiguo 26/11/2011, 13:27
webankenovi
Invitado
 
Mensajes: n/a
Puntos:
Respuesta: inicio de sesion

el karma esta en la esquina drecha abajo +0 -0 ay me puedes dar si kieres.

te voy pasando los codigos
  #82 (permalink)  
Antiguo 26/11/2011, 13:30
webankenovi
Invitado
 
Mensajes: n/a
Puntos:
Respuesta: inicio de sesion

el primero

Código PHP:
Ver original
  1. <?php
  2.     session_start();
  3.     if (!file_exists('Connections/config.php')){
  4.        
  5.         header('Location: install.php');
  6.        
  7.         } else {
  8.            
  9.         require_once('Connections/config.php');
  10.        
  11.         }
  12.         include_once('modulos/mod_menu/user_mod.php'); //// revisa esta ruta
  13.         include_once('cover/header.php'); ?>
  14.      
  15.         <div id="marco">
  16.         <div id="header">
  17.         <div id="logo">
  18.         <div id="menu"><?php include('modulos/mod_menu/menu.php'); ?></div>
  19.         </div>
  20.         </div>
  21.         <div id="contenido">
  22.         <div id="sidebar"><?php include_once ('cover/sidebar.php'); ?></div>
  23.         <div id="conten"><?php include_once ('cover/sistem.php'); ?></div>
  24.         </div>
  25.         <div id="footframe">
  26.         <div id="time"><?php include_once ('modulos/mod_reloj/reloj.php'); ?></div>
  27.         <div id="footer"><?php include_once  ('cover/copyr.php'); ?></div>
  28.         </div>
  29.         </div>
  30.         <?php include_once ('cover/footer.php'); ?>
  #83 (permalink)  
Antiguo 26/11/2011, 13:33
webankenovi
Invitado
 
Mensajes: n/a
Puntos:
Respuesta: inicio de sesion

config y header como estan

Código PHP:
Ver original
  1. <?php
  2. # FileName="Connection_php_mysql.htm"
  3. # Type="MYSQL"
  4. # HTTP="true"
  5. $hostname_config = "localhost";
  6. $database_config = "frametech";
  7. $username_config = "root";
  8. $password_config = "";
  9. $config = mysql_pconnect($hostname_config, $username_config, $password_config) or trigger_error(mysql_error(),E_USER_ERROR);?>


Código PHP:
Ver original
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <title>mi pagina</title>
  5. <meta name="description" content=""/>
  6. <meta name="keywords" content=""/>
  7. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  8. <meta name="generator" content="http://artemlabs.com" />
  9. <meta name="robots" content="index,follow" />
  10. <link href="css/stylecssmemp.css" rel="stylesheet" type="text/css" />
  11. <link type="text/css" rel="stylesheet" media="all" href="css/sistem_acces.css" />
  12. </head>
  13. <body>
  #84 (permalink)  
Antiguo 26/11/2011, 13:41
webankenovi
Invitado
 
Mensajes: n/a
Puntos:
Respuesta: inicio de sesion

menu

Código PHP:
Ver original
  1. <?php if(isset($_SESSION['MM_Username'])) {    ?>  
  2. <table width="auto" border="0" cellspacing="0">
  3. <tr>
  4. <td><table width="auto" border="0" cellspacing="0">
  5. <tr>
  6. <td><table width="auto" border="0" cellspacing="0">
  7. <tr>
  8. <td><img src="http://www.forosdelweb.com/images/icono_usuario.png" width="25" height="26"/></td>
  9. <td>
  10. <?php echo 'bienvenido'.$_SESSION['MM_Username'] ; ?></td>
  11. </tr>
  12. </table>
  13. </td>
  14. </tr>
  15. <tr>
  16. <td><center><a href="index.php?seccion=welcome">Desconectar</a>
  17. </center></td>
  18. </tr>
  19. </table>
  20. </td>
  21. </tr>
  22. </table>
  23. <?php }else{?>
  24. <table width="100%" border="0" cellspacing="0">
  25. <tr>
  26.  <td><a href="index.php?seccion=welcome">Inicio</a></td>
  27. <td><a href="index.php?seccion=ingresar">Ingresar</a></td>
  28. </tr>
  29. </table>
  30. <?php }?>
  #85 (permalink)  
Antiguo 26/11/2011, 13:43
webankenovi
Invitado
 
Mensajes: n/a
Puntos:
Respuesta: inicio de sesion

user_mod

Código PHP:
Ver original
  1. <?php
  2. $MM_authorizedUsers = "";
  3. $MM_donotCheckaccess = "true";
  4.  
  5. // *** Restrict Access To Page: Grant or deny access to this page
  6. function isAuthorized($strUsers, $strGroups, $UserName, $UserGroup) {
  7. // For security, start by assuming the visitor is NOT authorized.
  8. $isValid = False;
  9.  
  10. // When a visitor has logged into this site, the Session variable MM_Username set equal to their username.
  11. // Therefore, we know that a user is NOT logged in if that Session variable is blank.
  12. if (!empty($UserName)) {
  13. // Besides being logged in, you may restrict access to only certain users based on an ID established when they login.
  14. // Parse the strings into arrays.
  15. $arrUsers = Explode(",", $strUsers);
  16. $arrGroups = Explode(",", $strGroups);
  17. if (in_array($UserName, $arrUsers)) {
  18. $isValid = true;
  19. }
  20. // Or, you may restrict access to only certain users based on their username.
  21. if (in_array($UserGroup, $arrGroups)) {
  22. $isValid = true;
  23. }
  24. if (($strUsers == "") && true) {
  25. $isValid = true;
  26. }
  27. }
  28. return $isValid;
  29. }
  30.  
  31. $MM_restrictGoTo = "index.php";
  32. if (!((isset($_SESSION['MM_Username'])) && (isAuthorized("",$MM_authorizedUsers, $_SESSION['MM_Username'], $_SESSION['MM_UserGroup'])))) {
  33. $MM_qsChar = "?";
  34. $MM_referrer = $_SERVER['PHP_SELF'];
  35. if (strpos($MM_restrictGoTo, "?")) $MM_qsChar = "&";
  36. if (isset($QUERY_STRING) && strlen($QUERY_STRING) > 0)
  37. $MM_referrer .= "?" . $QUERY_STRING;
  38. $MM_restrictGoTo = $MM_restrictGoTo. $MM_qsChar . "accesscheck=" . urlencode($MM_referrer);
  39. header("Location: ". $MM_restrictGoTo);
  40. }
  41.  
  42. if (!function_exists("GetSQLValueString")) {
  43. function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
  44. {
  45. if (PHP_VERSION < 6) {
  46. $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
  47. }
  48.  
  49. $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
  50.  
  51. switch ($theType) {
  52. case "text":
  53. $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
  54. break;
  55. case "long":
  56. case "int":
  57. $theValue = ($theValue != "") ? intval($theValue) : "NULL";
  58. break;
  59. case "double":
  60. $theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
  61. break;
  62. case "date":
  63. $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
  64. break;
  65. case "defined":
  66. $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
  67. break;
  68. }
  69. return $theValue;
  70. }
  71. }
  72.  
  73. mysql_select_db($database_config, $config);
  74. $query_Recordset1 = "SELECT * FROM ft_usuarios";
  75. $Recordset1 = mysql_query($query_Recordset1, $config) or die(mysql_error());
  76. $row_Recordset1 = mysql_fetch_assoc($Recordset1);
  77. $totalRows_Recordset1 = mysql_num_rows($Recordset1);
  78. mysql_free_result($Recordset1);
  79. ?>
  #86 (permalink)  
Antiguo 26/11/2011, 13:43
webankenovi
Invitado
 
Mensajes: n/a
Puntos:
Respuesta: inicio de sesion

ok ya me cuentas
  #87 (permalink)  
Antiguo 26/11/2011, 13:50
webankenovi
Invitado
 
Mensajes: n/a
Puntos:
Respuesta: inicio de sesion

ay que acer un pequeño cambio pero primero prueba y me cuentas y ya te digo yo
  #88 (permalink)  
Antiguo 26/11/2011, 14:14
Avatar de memp500  
Fecha de Ingreso: octubre-2011
Ubicación: venezuela
Mensajes: 40
Antigüedad: 12 años, 6 meses
Puntos: 0
Respuesta: inicio de sesion

hice el cambio y lanza este error:

Warning: Cannot modify header information - headers already sent by (output started at /home/sidarco/public_html/intranet/nuevo/modulos/mod_menu/user_mod.php:1) in /home/sidarco/public_html/intranet/nuevo/sec/inicio.php on line 78

creo que el problema sigue siendo el header.php claro en este caso el user_mod.php ya que lo colocamos antes de el contenido de inicio.php

dejame probar una alternativa que estoy pensando a ver si asi va la cosa. mi alternativa es la siguiente: (aunque tendre que trabajar mas):

index.php:

Código PHP:
Ver original
  1. <?php
  2. /*////////////////////////////////////////////////////*/
  3. /*    Insurance Broker Sistem By ARTEM LABS, CA      */
  4. /*//////////////////////////////////////////////////*/
  5. /* Comprobamos que existe el archivo config.php */
  6. if (!file_exists("Connections/config.php")){
  7. /* Si existe redireccionamos al archivo install.php */
  8. header("Location: install.php");
  9. } else {
  10. /* Si no existe ejecutamos el index normalmente */
  11.     require("Connections/config.php"); //Requerimos config.php
  12. }
  13. ?>
  14. <?php
  15. /* Conectamos con la Base de Datos */
  16. include("Connections/config.php");
  17. ?>
  18. <?php
  19. /* Iniciamos Sesiones */
  20. <?php
  21. /* Pagina Principal Inicio/Index.php */
  22. include_once ("cover/sistem.php"); ?>

y luego dentro en

INICIO.PHP

Código PHP:
Ver original
  1. <? codigo PHP? de INICIO >
  2. <div id="marco">
  3. <div id="header">
  4. <div id="logo">
  5. <div id="menu"><?php include("modulos/mod_menu/menu.php"); ?>
  6. </div>
  7. </div>
  8. </div>
  9. <div id="contenido">
  10. <div id="sidebar"><?php include("cover/sidebar.php"); ?></div>
  11. <div id="conten">AQUI EL CODIGO HTML o EL FORMULARIO DE ENTRADA DE INICIO.PHP</div>
  12. </div>
  13. <div id="footframe">
  14. <div id="time"><?php include("modulos/mod_reloj/reloj.php"); ?></div>
  15. <div id="footer"><?php include("cover/copyr.php"); ?></div>
  16. </div>
  17. </div>
  18. <?php include("cover/footer.php"); ?>

luego en welcome y todas las otras paginas del sistema:

WELCOME.PHP

[HIGHLIGHT="PHP"]
Código PHP:
Ver original
  1. <? codigo PHP?> de welcome
  2. <div id="marco">
  3. <div id="header">
  4. <div id="logo">
  5. <div id="menu"><?php include("modulos/mod_menu/menu.php"); ?>
  6. </div>
  7. </div>
  8. </div>
  9. <div id="contenido">
  10. <div id="sidebar"><?php include("cover/sidebar.php"); ?></div>
  11. <div id="conten">AQUI EL CODIGO HTML o DE WELCOME.PHP</div>
  12. </div>
  13. <div id="footframe">
  14. <div id="time"><?php include("modulos/mod_reloj/reloj.php"); ?></div>
  15. <div id="footer"><?php include("cover/copyr.php"); ?></div>
  16. </div>
  17. </div>
  18. <?php include("cover/footer.php"); ?>

ahora si existe alguna forma de hacer los mismo pero mas simple pues avisame
__________________
crear soluciones y oportunidades de desarrollo y crecimiento
  #89 (permalink)  
Antiguo 26/11/2011, 14:16
webankenovi
Invitado
 
Mensajes: n/a
Puntos:
Respuesta: inicio de sesion

yo ske lo hago como te dije anteriormente no entiendo xq el html lo tienes q hacer por php con un include yl final en el footer
  #90 (permalink)  
Antiguo 26/11/2011, 14:20
Avatar de memp500  
Fecha de Ingreso: octubre-2011
Ubicación: venezuela
Mensajes: 40
Antigüedad: 12 años, 6 meses
Puntos: 0
Respuesta: inicio de sesion

voy a probar asi incluyendo <?php include("cover/header.php"); ?> dentro del archivo de inicio.php osea como tu lo haces, pero en mi caso trabajare mas por que en todos los archivos de secciones debo incluir el menu el sidebar y el footer
__________________
crear soluciones y oportunidades de desarrollo y crecimiento

Etiquetas: sesión, sesiones_en_php
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 15:43.