Foros del Web » Programando para Internet » PHP »

porque no se interpreta mi php

Estas en el tema de porque no se interpreta mi php en el foro de PHP en Foros del Web. hola .. fanaticos del foro del web ... porque no me pasa el valor en php al input ... genera error ??? Código PHP: <?xml version ...
  #1 (permalink)  
Antiguo 23/09/2009, 15:26
Avatar de Superlinux  
Fecha de Ingreso: octubre-2005
Ubicación: Colombia
Mensajes: 662
Antigüedad: 18 años, 6 meses
Puntos: 1
Pregunta porque no se interpreta mi php

hola .. fanaticos del foro del web ... porque no me pasa el valor en php al input ... genera error ???

Código PHP:
<?xml version="1.0" encoding="[CONTENT_ENCODING/]"?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../../css/xhtml1-strict.dtd">

<?php
// ______________CREACION DE LA SESION POR PRIMERA VEZ ___________________________________________

//Por medio de esta función inicializo la sesion
session_start();

//Validamos que no se pueda ingresar de otra forma que no sea por medio de login
if(!$_SESSION[usuario])
{
    print 
"<META HTTP-EQUIV=\"Refresh\" CONTENT=\"0;URL=cerrar_session.php\">";
}else{

    
// objeto de visualización de Mensajes, recibe 0 si es Admin, y el ID si es reseller
    
$regusuario $sql->seleccionar("regusuario""*""usuario ='".$_SESSION[usuario]."'"); 
?>

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="[LANG_CODE/]" lang="[LANG_CODE/]" dir="[BASE_DIRECTION/]">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>[LANG]title[/LANG]</title>
<style type="text/css">
body {
    padding:0;
    margin:0;
}
</style>
[STYLE_SHEETS/]
<script src="js/chat.js" type="text/javascript" charset="UTF-8"></script>
<script src="js/lang/[LANG_CODE/].js" type="text/javascript" charset="UTF-8"></script>
<script src="js/config.js" type="text/javascript" charset="UTF-8"></script>
<script type="text/javascript">
// <![CDATA[
    function initializeLoginPage() {
        document.getElementById('userNameField').focus();
        if(!ajaxChat.isCookieEnabled()) {
            var node = document.createElement('div');
            var text = document.createTextNode(ajaxChatLang['errorCookiesRequired']);
            node.appendChild(text);
            document.getElementById('errorContainer').appendChild(node);
        }
    }
    
    ajaxChatConfig.sessionName = '[SESSION_NAME/]';
    ajaxChatConfig.cookieExpiration = parseInt('[COOKIE_EXPIRATION/]');
    ajaxChatConfig.cookiePath = '[COOKIE_PATH/]';
    ajaxChatConfig.cookieDomain = '[COOKIE_DOMAIN/]';
    ajaxChatConfig.cookieSecure = '[COOKIE_SECURE/]';

    ajaxChat.init(ajaxChatConfig, ajaxChatLang, true, true, false);
// ]]>
</script>

<link href="../../../css/estilos_adminesp.css" rel="stylesheet" type="text/css"/>

</head>

<body onload="initializeLoginPage();">
<table width="333" height="400" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td width="327" valign="top">
      <div id="loginHeadlineContainer">
        <h1 align="center">[LANG]title[/LANG]</h1>
      </div>
      <form id="loginForm" action="[LOGIN_URL/]" method="post" enctype="application/x-www-form-urlencoded">
        <div id="loginFormContainer">
          <input type="hidden" name="login" id="loginField" value="login"/>
          <input type="hidden" name="redirect" id="redirectField" value="[REDIRECT_URL/]"/>
          <div align="center">
            <label for="userNameField">[LANG]userName[/LANG]:</label>
            <br />
            <input name="userName" type="text" id="userNameField" value="<? echo $regusuario[email?>" maxlength="[USER_NAME_MAX_LENGTH/]"/>
          </div>
          <div align="center">
            <label for="channelField"></label>
            <div>
              <label for="passwordField">[LANG]password[/LANG]:</label>
              <br />
              <input type="password" name="password" id="passwordField"/>
            </div>
            <br />
            <select name="channelName" id="channelField">
              [CHANNEL_OPTIONS/]
            </select>
          </div>
          <br />
          <div align="center">
            <input type="submit" name="submit" id="loginButton" value="[LANG]login[/LANG]"/>
          </div>
        </div>
      </form>
      <br />
      <div id="errorContainer">[ERROR_MESSAGES/]
          <noscript>
            <div>[LANG]requiresJavaScript[/LANG]</div>
          </noscript>
      </div>
      <br /></td>
  </tr>
</table>
</body>
</html>
<?php
}//Fin del if
?>
__________________
"La vida sigue su curso, tú toma parte de ella."
  #2 (permalink)  
Antiguo 23/09/2009, 15:49
Avatar de bioxido  
Fecha de Ingreso: diciembre-2008
Ubicación: $_SERVER['PHP_SELF']
Mensajes: 601
Antigüedad: 15 años, 4 meses
Puntos: 21
Respuesta: porque no se interpreta mi php

Usa los tags completos, no siempre esta configurado para trabajar con los cortos (?>) y, te falta un ; al final del echo.

Código PHP:
<?php echo $regusuario[email]; ?>
  #3 (permalink)  
Antiguo 23/09/2009, 16:06
Avatar de Superlinux  
Fecha de Ingreso: octubre-2005
Ubicación: Colombia
Mensajes: 662
Antigüedad: 18 años, 6 meses
Puntos: 1
Pregunta Respuesta: porque no se interpreta mi php

este es el error que me visualiza ..


Error de lectura XML: mal formado
Ubicación: http://localhost/guiavital/chat/index.php?id=3
Número de línea 74, columna 74: <input name="userName" type="text" id="userNameField" value="<?php echo $regusuario[email]; ?>" maxlength="80"/>
-------------------------------------------------------------------------^
__________________
"La vida sigue su curso, tú toma parte de ella."
  #4 (permalink)  
Antiguo 23/09/2009, 17:46
 
Fecha de Ingreso: diciembre-2008
Mensajes: 118
Antigüedad: 15 años, 4 meses
Puntos: 6
Respuesta: porque no se interpreta mi php

[PHP]<?php echo $regusuario['email']; ?>
  #5 (permalink)  
Antiguo 24/09/2009, 08:11
Avatar de Superlinux  
Fecha de Ingreso: octubre-2005
Ubicación: Colombia
Mensajes: 662
Antigüedad: 18 años, 6 meses
Puntos: 1
Respuesta: porque no se interpreta mi php

nada ...

Código PHP:
<input name="userName" type="text" id="userNameField" value="[php]<?php echo $regusuario['email']; ?>
" maxlength="[USER_NAME_MAX_LENGTH/]"/>
[/PHP]

hice la prueba pasando un valor fijo .. pero tampoco funciona

Código PHP:
<input name="userName" type="text" id="userNameField" value="[php]<?php echo "hola"?>
" maxlength="[USER_NAME_MAX_LENGTH/]"/>
[/PHP]

mmmmmm
__________________
"La vida sigue su curso, tú toma parte de ella."
  #6 (permalink)  
Antiguo 24/09/2009, 08:18
 
Fecha de Ingreso: diciembre-2008
Mensajes: 190
Antigüedad: 15 años, 4 meses
Puntos: 6
Respuesta: porque no se interpreta mi php

sin el [php] jeje, se le chispoteo al querer envolverlo

Código PHP:
<input name="userName" type="text" id="userNameField" value="<?php echo $regusuario['email']; ?>"
 />
  #7 (permalink)  
Antiguo 24/09/2009, 08:29
Avatar de Superlinux  
Fecha de Ingreso: octubre-2005
Ubicación: Colombia
Mensajes: 662
Antigüedad: 18 años, 6 meses
Puntos: 1
Pregunta Respuesta: porque no se interpreta mi php

mmmm .. no logro hacerlo ..

como hago para pasar el valor ????

Código PHP:
<input name="userName" type="text" id="userNameField" value="<?php echo $regusuario['email']; ?>"
 />
alguna idea ????
__________________
"La vida sigue su curso, tú toma parte de ella."
  #8 (permalink)  
Antiguo 24/09/2009, 08:48
 
Fecha de Ingreso: diciembre-2008
Mensajes: 190
Antigüedad: 15 años, 4 meses
Puntos: 6
Respuesta: porque no se interpreta mi php

eso esta bien, te fijaste si la consulta a la BBDD es correcta y devuelve algo?
  #9 (permalink)  
Antiguo 24/09/2009, 08:58
Avatar de Superlinux  
Fecha de Ingreso: octubre-2005
Ubicación: Colombia
Mensajes: 662
Antigüedad: 18 años, 6 meses
Puntos: 1
Respuesta: porque no se interpreta mi php

claro la consulta funciona el problema es que los valores los se pasa por xml

este es el error

Error de lectura XML: mal formado
Ubicación: http://localhost/guiavital/chat/index.php?id=3
Número de línea 73, columna 74: <input name="userName" type="text" id="userNameField" value="<?php echo $regusuario['email']; ?>" maxlength="80"/>

este es todo el php

Código PHP:
<?xml version="1.0" encoding="[CONTENT_ENCODING/]"?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../../css/xhtml1-strict.dtd">

<?php
// ______________CREACION DE LA SESION POR PRIMERA VEZ ___________________________________________

//Por medio de esta función inicializo la sesion
session_start();

//Validamos que no se pueda ingresar de otra forma que no sea por medio de login
if(!$_SESSION[usuario])
{
    print 
"<META HTTP-EQUIV=\"Refresh\" CONTENT=\"0;URL=cerrar_session.php\">";
}else{

    
// objeto de visualización de Mensajes, recibe 0 si es Admin, y el ID si es reseller
    
$regusuario $sql->seleccionar("regusuario""*""usuario ='".$_SESSION[usuario]."'"); 
?>

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="[LANG_CODE/]" lang="[LANG_CODE/]" dir="[BASE_DIRECTION/]">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>[LANG]title[/LANG]</title>
<style type="text/css">
body {
    padding:0;
    margin:0;
}
</style>
[STYLE_SHEETS/]
<script src="js/chat.js" type="text/javascript" charset="UTF-8"></script>
<script src="js/lang/[LANG_CODE/].js" type="text/javascript" charset="UTF-8"></script>
<script src="js/config.js" type="text/javascript" charset="UTF-8"></script>
<script type="text/javascript">
// <![CDATA[
    function initializeLoginPage() {
        document.getElementById('userNameField').focus();
        if(!ajaxChat.isCookieEnabled()) {
            var node = document.createElement('div');
            var text = document.createTextNode(ajaxChatLang['errorCookiesRequired']);
            node.appendChild(text);
            document.getElementById('errorContainer').appendChild(node);
        }
    }
    
    ajaxChatConfig.sessionName = '[SESSION_NAME/]';
    ajaxChatConfig.cookieExpiration = parseInt('[COOKIE_EXPIRATION/]');
    ajaxChatConfig.cookiePath = '[COOKIE_PATH/]';
    ajaxChatConfig.cookieDomain = '[COOKIE_DOMAIN/]';
    ajaxChatConfig.cookieSecure = '[COOKIE_SECURE/]';

    ajaxChat.init(ajaxChatConfig, ajaxChatLang, true, true, false);
// ]]>
</script>

<link href="../../../css/estilos_adminesp.css" rel="stylesheet" type="text/css"/>

</head>

<body onload="initializeLoginPage();">
<table width="333" height="400" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td width="327" valign="top">
      <div id="loginHeadlineContainer">
        <h1 align="center">[LANG]title[/LANG]</h1>
      </div>
      <form id="loginForm" action="[LOGIN_URL/]" method="post" enctype="application/x-www-form-urlencoded">
        <div id="loginFormContainer">
          <input type="hidden" name="login" id="loginField" value="login"/>
          <input type="hidden" name="redirect" id="redirectField" value="[REDIRECT_URL/]"/>
          <div align="center">
            <label for="userNameField">[LANG]userName[/LANG]:</label>
            <br />
            <input name="userName" type="text" id="userNameField" value="<? echo $regusuario[email?>" maxlength="[USER_NAME_MAX_LENGTH/]"/>
          </div>
          <div align="center">
            <label for="channelField"></label>
            <div>
              <label for="passwordField">[LANG]password[/LANG]:</label>
              <br />
              <input type="password" name="password" id="passwordField"/>
            </div>
            <br />
            <select name="channelName" id="channelField">
              [CHANNEL_OPTIONS/]
            </select>
          </div>
          <br />
          <div align="center">
            <input type="submit" name="submit" id="loginButton" value="[LANG]login[/LANG]"/>
          </div>
        </div>
      </form>
      <br />
      <div id="errorContainer">[ERROR_MESSAGES/]
          <noscript>
            <div>[LANG]requiresJavaScript[/LANG]</div>
          </noscript>
      </div>
      <br /></td>
  </tr>
</table>
</body>
</html>
<?php
}//Fin del if
?>

mmmm lo que busco es que el valor de consulta a la bd .. pase al input .. pero en formato xml
__________________
"La vida sigue su curso, tú toma parte de ella."
  #10 (permalink)  
Antiguo 24/09/2009, 10:04
Avatar de GatorV
$this->role('moderador');
 
Fecha de Ingreso: mayo-2006
Ubicación: /home/ams/
Mensajes: 38.567
Antigüedad: 17 años, 10 meses
Puntos: 2135
Respuesta: porque no se interpreta mi php

Seguro ese es todo el código? ya que al parecer no esta ejecutando el PHP, no lo estas incluyendo desde otro archivo o algo similar?

Saludos.
  #11 (permalink)  
Antiguo 24/09/2009, 10:12
Avatar de Marvin
Colaborador
 
Fecha de Ingreso: febrero-2005
Ubicación: global $Chile->Santiago;
Mensajes: 1.991
Antigüedad: 19 años, 2 meses
Puntos: 81
Respuesta: porque no se interpreta mi php

Viste el codigo fuente de la pagina cuando te tira el error ?...

Aps.. como dato extra para usar <? puedes hacerlo de esta manera:
Código PHP:
<?=$regusuario[email]?>
Suerte!
__________________
El que dice "Solo sé que nada sé", esta asumiendo que sabe algo.
Lea las FAQ's!
  #12 (permalink)  
Antiguo 24/09/2009, 10:34
Avatar de Superlinux  
Fecha de Ingreso: octubre-2005
Ubicación: Colombia
Mensajes: 662
Antigüedad: 18 años, 6 meses
Puntos: 1
Respuesta: porque no se interpreta mi php

nada aun ...

lo deje asi segun sugencia ...

Código PHP:
<input name="userName" type="text" id="userNameField" value="<?=$regusuario[email]?>" maxlength="[USER_NAME_MAX_LENGTH/]"/>
si ese es el codigo ..

mmmmmmmmm
__________________
"La vida sigue su curso, tú toma parte de ella."
  #13 (permalink)  
Antiguo 24/09/2009, 10:46
Avatar de GatorV
$this->role('moderador');
 
Fecha de Ingreso: mayo-2006
Ubicación: /home/ams/
Mensajes: 38.567
Antigüedad: 17 años, 10 meses
Puntos: 2135
Respuesta: porque no se interpreta mi php

No me haz respondido como es que haces el llamado a ese código, ya que si no se esta interpretando es por algo, y puede ser que no lo estes pasando por el parser de PHP.

Saludos.
  #14 (permalink)  
Antiguo 24/09/2009, 10:47
Avatar de Superlinux  
Fecha de Ingreso: octubre-2005
Ubicación: Colombia
Mensajes: 662
Antigüedad: 18 años, 6 meses
Puntos: 1
Pregunta Respuesta: porque no se interpreta mi php

.... si paso el valor al input asi ..

Código PHP:
<input name="userName" type="text" id="userNameField" value="prueba" maxlength="[USER_NAME_MAX_LENGTH/]"/> 
no hay problema el detalle esta cuando deseo pasar al value ... un valor de una variable ..

mmmmmmmmmmmm
__________________
"La vida sigue su curso, tú toma parte de ella."
  #15 (permalink)  
Antiguo 24/09/2009, 11:32
Avatar de GatorV
$this->role('moderador');
 
Fecha de Ingreso: mayo-2006
Ubicación: /home/ams/
Mensajes: 38.567
Antigüedad: 17 años, 10 meses
Puntos: 2135
Respuesta: porque no se interpreta mi php

Pero desde donde ejecutas ese código? Directo por URL? o lo incluyes usando otro archivo?.
  #16 (permalink)  
Antiguo 24/09/2009, 12:27
Avatar de Superlinux  
Fecha de Ingreso: octubre-2005
Ubicación: Colombia
Mensajes: 662
Antigüedad: 18 años, 6 meses
Puntos: 1
Pregunta Respuesta: porque no se interpreta mi php

necesito pasar los valores de las siguiente consulta a los input

Código PHP:
<?php
// ______________CREACION DE LA SESION POR PRIMERA VEZ ___________________________________________

//Por medio de esta función inicializo la sesion
session_start();

//Validamos que no se pueda ingresar de otra forma que no sea por medio de login
if(!$_SESSION[usuario])
{
    print 
"<META HTTP-EQUIV=\"Refresh\" CONTENT=\"0;URL=cerrar_session.php\">";
}else{

    
// objeto de visualización de Mensajes, recibe 0 si es Admin, y el ID si es reseller
    
$regusuario $sql->seleccionar("regusuario""*""usuario ='".$_SESSION[usuario]."'"); 

//si paso <?php ?> me genera error de interpretacion xml

 <input name="userName" type="text" id="userNameField" value="<? echo $regusuario[email]?>" maxlength="[USER_NAME_MAX_LENGTH/]"/>

// si paso una cadena .. funciona bien ,, el campo input isualiza prueba

 <input name="userName" type="text" id="userNameField" value="prueba" maxlength="[USER_NAME_MAX_LENGTH/]"/>
lo que pasa es que deseo llenar los campos usuario y contraseña con los datos ya contenidos en la tabla regusuario ... para que el vistante no tenga que digitar nada a la hora de entrar al chat ...

mmmm
__________________
"La vida sigue su curso, tú toma parte de ella."
  #17 (permalink)  
Antiguo 24/09/2009, 14:58
Avatar de GatorV
$this->role('moderador');
 
Fecha de Ingreso: mayo-2006
Ubicación: /home/ams/
Mensajes: 38.567
Antigüedad: 17 años, 10 meses
Puntos: 2135
Respuesta: porque no se interpreta mi php

Si pero no muestras como es que ejecutas ese código, ya que si lo pasas por un file_get_contents obviamente no va a servir por eso mi comentario a como era el proceso de ejecución de tu script.
  #18 (permalink)  
Antiguo 01/10/2009, 10:40
Avatar de Superlinux  
Fecha de Ingreso: octubre-2005
Ubicación: Colombia
Mensajes: 662
Antigüedad: 18 años, 6 meses
Puntos: 1
Pregunta Respuesta: porque no se interpreta mi php

bueno .. el chat que estoy implementando es el conocido .. ajaxchat
__________________
"La vida sigue su curso, tú toma parte de ella."
  #19 (permalink)  
Antiguo 01/10/2009, 10:51
Avatar de GatorV
$this->role('moderador');
 
Fecha de Ingreso: mayo-2006
Ubicación: /home/ams/
Mensajes: 38.567
Antigüedad: 17 años, 10 meses
Puntos: 2135
Respuesta: porque no se interpreta mi php

Aún no especificas como es que ejecutas el código, ya que al parecer no lo estas pasando por el interprete de PHP.

Esas son causas de que el archivo tiene una extensión .html o diferente a .php, o que lo estas incluyendo en otra pagina usando file_get_contens o algo similar. Para ejecutar el archivo PHP tienes que pasarlo por include() forzosamente.

Saludos.
  #20 (permalink)  
Antiguo 01/10/2009, 13:31
Avatar de Superlinux  
Fecha de Ingreso: octubre-2005
Ubicación: Colombia
Mensajes: 662
Antigüedad: 18 años, 6 meses
Puntos: 1
Pregunta Respuesta: porque no se interpreta mi php

hola gatorv ... mira este es el archivo config el cual pasa los paramentros por default al archivo loggedOut.php donde capturo el nombre de usuario, contraseña y sala

si observas $usuario = 3; le paso el valor 3 .. el cual es el id del usuario ... pero lo deseo capturar con session o get o post el id para realizar la consulta y pasar los valores predeterminados como son id, usuario y contraseña

en el config paso la variable

// ChannelID used when no channel is given:
$config['defaultChannelID'] = $regusuario['IdUsuario'];

con la cual paso un dato por defecto en el archivo loggedOut.php

<select name="channelName" id="channelField">
[CHANNEL_OPTIONS/]
</select>


$regusuario = $sql->seleccionar("regusuario", "*", "IdUsuario ='".$usuario."'");

Código PHP:
<?php
//Archivo de conexion
require("data/connect.php");

$usuario 3;

// objeto de visualización de Mensajes, recibe 0 si es Admin, y el ID si es reseller
$regusuario $sql->seleccionar("regusuario""*""IdUsuario ='".$usuario."'");  

/*
 * @package AJAX_Chat
 * @author Sebastian Tschan
 * @copyright (c) Sebastian Tschan
 * @license GNU Affero General Public License
 * @link https://blueimp.net/ajax/
 */

// Define AJAX Chat user roles:
define('AJAX_CHAT_CHATBOT',        4);
define('AJAX_CHAT_ADMIN',        3);
define('AJAX_CHAT_MODERATOR',    2);
define('AJAX_CHAT_USER',        1);
define('AJAX_CHAT_GUEST',        0);

// AJAX Chat config parameters:
$config = array();

// Database connection values:
$config['dbConnection'] = array();

// Database hostname:
$config['dbConnection']['host'] = 'localhost';

// Database username:
$config['dbConnection']['user'] = 'root';

// Database password:
$config['dbConnection']['pass'] = '';

// Database name:
$config['dbConnection']['name'] = 'ampalacios';
// Database type:
$config['dbConnection']['type'] = null;
// Database link:
$config['dbConnection']['link'] = null;

// Database table names:
$config['dbTableNames'] = array();
$config['dbTableNames']['online']        = 'ajax_chat_online';
$config['dbTableNames']['messages']        = 'ajax_chat_messages';
$config['dbTableNames']['bans']            = 'ajax_chat_bans';
$config['dbTableNames']['invitations']    = 'ajax_chat_invitations';

// Available languages:
$config['langAvailable'] = array('es');
// Default language:
$config['langDefault'] = 'es';
// Language names:
$config['langNames'] = array('es'=>'Español');

// Available styles:
$config['styleAvailable'] = array('silver');
// Default style:
$config['styleDefault'] = 'silver';

// The encoding used for the XHTML content:
$config['contentEncoding'] = 'UTF-8';
// The encoding of the data source, like userNames and channelNames:
$config['sourceEncoding'] = 'UTF-8';
// The content-type of the XHTML page (e.g. "text/html", will be set dependent on browser capabilities if set to null):
$config['contentType'] = null;

// Session name used to identify the session cookie:
$config['sessionName'] = 'guiavital_chat';
// Prefix added to every session key:
$config['sessionKeyPrefix'] = 'guiavital';
// The lifetime of the language, style and setting cookies in days:
$config['sessionCookieLifeTime'] = 365;
// The path of the cookies, '/' allows to read the cookies from all directories:
$config['sessionCookiePath'] = '/';
// The domain of the cookies, defaults to the hostname of the server if set to null:
$config['sessionCookieDomain'] = null;
// If enabled, cookies must be sent over secure (SSL/TLS encrypted) connections:
$config['sessionCookieSecure'] = null;

$config['defaultChannelName'] = $regusuario['usuario'];

// ChannelID used when no channel is given:
$config['defaultChannelID'] = $regusuario['IdUsuario'];

// Defines an array of channelIDs (e.g. array(0, 1)) to limit the number of available channels, will be ignored if set to null:
$config['limitChannelList'] = null;

// UserID plus this value are private channels (this is also the max userID and max channelID):
$config['privateChannelDiff'] = 500000000;
// UserID plus this value are used for private messages:
$config['privateMessageDiff'] = 1000000000;

// Enable/Disable private Channels:
$config['allowPrivateChannels'] = true;
// Enable/Disable private Messages:
$config['allowPrivateMessages'] = true;

// Private channels should be distinguished by either a prefix or a suffix or both (no whitespace):
$config['privateChannelPrefix'] = '[';
// Private channels should be distinguished by either a prefix or a suffix or both (no whitespace):
$config['privateChannelSuffix'] = ']';

// If enabled, users will be logged in automatically as guest users (if allowed), if not authenticated:
$config['forceAutoLogin'] = false;

// Defines if login/logout and channel enter/leave are displayed:
$config['showChannelMessages'] = true;

// If enabled, the chat will only be accessible for the admin:
$config['chatClosed'] = false;
// Defines the timezone offset in seconds (-12*60*60 to 12*60*60) - if null, the server timezone is used:
$config['timeZoneOffset'] = null;
// Defines the hour of the day the chat is opened (0 - closingHour):
$config['openingHour'] = 0;
// Defines the hour of the day the chat is closed (openingHour - 24):
$config['closingHour'] = 24;
// Defines the weekdays the chat is opened (0=Sunday to 6=Saturday):
$config['openingWeekDays'] = array(0,1,2,3,4,5,6);

// Enable/Disable guest logins:
$config['allowGuestLogins'] = true;
// Enable/Disable write access for guest users - if disabled, guest users may not write messages:
$config['allowGuestWrite'] = true;
// Allow/Disallow guest users to choose their own userName:
$config['allowGuestUserName'] = true;
// Guest users should be distinguished by either a prefix or a suffix or both (no whitespace):
$config['guestUserPrefix'] = '(';
// Guest users should be distinguished by either a prefix or a suffix or both (no whitespace):
$config['guestUserSuffix'] = ')';
// Guest userIDs may not be lower than this value (and not higher than privateChannelDiff):
$config['minGuestUserID'] = 400000000;

// Allow/Disallow users to change their userName (Nickname):
$config['allowNickChange'] = true;
// Changed userNames should be distinguished by either a prefix or a suffix or both (no whitespace):
$config['changedNickPrefix'] = '(';
// Changed userNames should be distinguished by either a prefix or a suffix or both (no whitespace):
$config['changedNickSuffix'] = ')';

// Allow/Disallow registered users to delete their own messages:
$config['allowUserMessageDelete'] = true;

// The userID used for ChatBot messages:
$config['chatBotID'] = 2147483647;
// The userName used for ChatBot messages
$config['chatBotName'] = 'Usuario';

// Minutes until a user is declared inactive (last status update) - the minimum is 2 minutes:
$config['inactiveTimeout'] = 2;
// Interval in minutes to check for inactive users:
$config['inactiveCheckInterval'] = 5;

// Defines if messages are shown which have been sent before the user entered the channel:
$config['requestMessagesPriorChannelEnter'] = true;
// Defines an array of channelIDs (e.g. array(0, 1)) for which the previous setting is always true (will be ignored if set to null):
$config['requestMessagesPriorChannelEnterList'] = null;
// Max time difference in hours for messages to display on each request:
$config['requestMessagesTimeDiff'] = 24;
// Max number of messages to display on each request:
$config['requestMessagesLimit'] = 10;

// Max users in chat (does not affect moderators or admins):
$config['maxUsersLoggedIn'] = 100;
// Max userName length:
$config['userNameMaxLength'] = 80;
// Max messageText length:
$config['messageTextMaxLength'] = 1040;
// Defines the max number of messages a user may send per minute:
$config['maxMessageRate'] = 20;

// Defines the default time in minutes a user gets banned if kicked from a moderator without ban minutes parameter:
$config['defaultBanTime'] = 5;

// Argument that is given to the handleLogout JavaScript method:
$config['logoutData'] = './?logout=true';

// If true, checks if the user IP is the same when logged in:
$config['ipCheck'] = true;

// Defines the max time difference in hours for logs when no period or search condition is given:
$config['logsRequestMessagesTimeDiff'] = 1;
// Defines how many logs are returned on each logs request:
$config['logsRequestMessagesLimit'] = 10;

// Defines the earliest year used for the logs selection:
$config['logsFirstYear'] = 2007;

// Defines if old messages are purged from the database:
$config['logsPurgeLogs'] = false;
// Max time difference in days for old messages before they are purged from the database:
$config['logsPurgeTimeDiff'] = 365;

// Defines if registered users (including moderators) have access to the logs (admins are always granted access):
$config['logsUserAccess'] = false;
// Defines a list of channels (e.g. array(0, 1)) to limit the logs access for registered users, includes all channels the user has access to if set to null:
$config['logsUserAccessChannelList'] = null;

// Defines if the socket server is enabled:
$config['socketServerEnabled'] = false;
// Defines the hostname of the socket server used to connect from client side (the server hostname is used if set to null):
$config['socketServerHost'] = null;
// Defines the IP of the socket server used to connect from server side to broadcast update messages:
$config['socketServerIP'] = '127.0.0.1';
// Defines the port of the socket server:
$config['socketServerPort'] = 1935;
// This ID can be used to distinguish between different chat installations using the same socket server:
$config['socketServerChatID'] = 0;
?>
__________________
"La vida sigue su curso, tú toma parte de ella."
  #21 (permalink)  
Antiguo 05/10/2009, 15:44
Avatar de Superlinux  
Fecha de Ingreso: octubre-2005
Ubicación: Colombia
Mensajes: 662
Antigüedad: 18 años, 6 meses
Puntos: 1
Pregunta Respuesta: porque no se interpreta mi php

por fin ...

muchas gracias Gatorv
__________________
"La vida sigue su curso, tú toma parte de ella."
  #22 (permalink)  
Antiguo 08/10/2009, 17:28
Avatar de Superlinux  
Fecha de Ingreso: octubre-2005
Ubicación: Colombia
Mensajes: 662
Antigüedad: 18 años, 6 meses
Puntos: 1
Respuesta: porque no se interpreta mi php

hola GatorV la unica forma que encontre para pasar el valor fu asi

index.php
Código PHP:
<?php
if($_GET['id']){
    if (
$descfopen("usuario.txt""w"));//abro el archivo en modo escritura.
    
{
        
fputs ($desc,$_GET['id']);//escribe una linea
        
fclose ($desc);
    }
//Fin del if
}//Fin del if

/*
 * @package AJAX_Chat
 * @author Sebastian Tschan
 * @copyright (c) Sebastian Tschan
 * @license GNU Affero General Public License
 * @link https://blueimp.net/ajax/
 */

// Show all errors:
error_reporting(E_ALL);

// Path to the chat directory:
define('AJAX_CHAT_PATH'dirname($_SERVER['SCRIPT_FILENAME']).'/');

// Include custom libraries and initialization code:
require(AJAX_CHAT_PATH.'lib/custom.php');

// Include Class libraries:
require(AJAX_CHAT_PATH.'lib/classes.php');

// Initialize the chat:
$ajaxChat = new CustomAJAXChat();
?>
config.php

Código PHP:
<?php
//Archivo de conexion
require("../connect.php");

$usuario = @file_get_contents("usuario.txt");

// objeto de visualización de Mensajes, recibe 0 si es Admin, y el ID si es reseller
$regusuario $sql->seleccionar("regusuario""*""IdUsuario ='".$usuario."'");   

// Usuario:
$config['sessionUsuario'] = $regusuario['usuario'];
// Contraseña:
$config['sessionContrasena'] = $regusuario['contrasena'];

// Default channelName used together with the defaultChannelID if no channel with this ID exists:
$config['defaultChannelName'] = $regusuario['usuario'];
// ChannelID used when no channel is given:
$config['defaultChannelID'] = $regusuario['IdUsuario'];
?>
pero el problema esta que cuando otro usuario entra cambia el valor del id que guarde en el txt ... y me cambia el canal

si tienes alguna idea de como hacerlo .. te lo agradeseria

__________________
"La vida sigue su curso, tú toma parte de ella."
  #23 (permalink)  
Antiguo 09/10/2009, 09:32
Avatar de GatorV
$this->role('moderador');
 
Fecha de Ingreso: mayo-2006
Ubicación: /home/ams/
Mensajes: 38.567
Antigüedad: 17 años, 10 meses
Puntos: 2135
Respuesta: porque no se interpreta mi php

Donde incluyes config e index?, ya que puedes usar una sesión para eso...

Saludos.
  #24 (permalink)  
Antiguo 09/10/2009, 10:58
Avatar de Superlinux  
Fecha de Ingreso: octubre-2005
Ubicación: Colombia
Mensajes: 662
Antigüedad: 18 años, 6 meses
Puntos: 1
De acuerdo

ok ... muchas gracias gatorv ... problema resuelto ...

mil gracias ..



ok listo problema resuelto ..

logra pasar por session ..

gracias foros del web
__________________
"La vida sigue su curso, tú toma parte de ella."

Última edición por jam1138; 09/10/2009 a las 21:01
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 09:34.