Foros del Web » Programando para Internet » PHP »

¿ Donde esta el problemas ?

Estas en el tema de ¿ Donde esta el problemas ? en el foro de PHP en Foros del Web. Buenas aller programando me surgio un error Fatal error: Cannot redeclare Session_state() (previously declared in C:\xampp\htdocs\losvagosdelaweb\include\bd.php:137 ) in C:\xampp\htdocs\losvagosdelaweb\include\bd.php on line 148 Estas son las ...
  #1 (permalink)  
Antiguo 06/05/2011, 11:19
Avatar de Lautaro_eb  
Fecha de Ingreso: mayo-2010
Ubicación: Bariloche, Argentina
Mensajes: 284
Antigüedad: 13 años, 11 meses
Puntos: 24
¿ Donde esta el problemas ?

Buenas aller programando me surgio un error
Fatal error: Cannot redeclare Session_state() (previously declared in C:\xampp\htdocs\losvagosdelaweb\include\bd.php:137 ) in C:\xampp\htdocs\losvagosdelaweb\include\bd.php on line 148
Estas son las lineas
Código PHP:
Ver original
  1. <?
  2. date_default_timezone_set('America/Argentina/Buenos_Aires');
  3. $conexion = mysql_connect("127.0.0.1","root","123865");
  4. if($conexion){
  5.     $db = mysql_select_db("vgw");
  6.     $sql = mysql_query("show tables");
  7.     if(mysql_num_rows($sql) == 0){
  8.         mysql_query("
  9.         SET SQL_MODE=\"NO_AUTO_VALUE_ON_ZERO\";
  10.        
  11.        
  12.         /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
  13.         /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
  14.         /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
  15.         /*!40101 SET NAMES utf8 */;
  16.        
  17.        
  18.         CREATE TABLE IF NOT EXISTS `categoriav` (
  19.           `id` int(11) NOT NULL AUTO_INCREMENT,
  20.           `nombre` varchar(30) NOT NULL,
  21.           `Subcategoria` int(2) NOT NULL DEFAULT '0',
  22.           `Subindexid` int(11) NOT NULL,
  23.           `Subnombre` text NOT NULL,
  24.           `ct_icon` text NOT NULL,
  25.           `ct_fech` date NOT NULL,
  26.           `ct_time` time NOT NULL,
  27.           `ct_n_public` int(11) NOT NULL DEFAULT '0',
  28.           `ct_n_comet` int(11) NOT NULL DEFAULT '0',
  29.           PRIMARY KEY (`id`)
  30.         ) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=9 ;
  31.        
  32.         INSERT INTO `categoriav` (`id`, `nombre`, `Subcategoria`, `Subindexid`, `Subnombre`, `ct_icon`, `ct_fech`, `ct_time`, `ct_n_public`, `ct_n_comet`) VALUES
  33.         (1, 'Juegos', 0, 0, '', 'cristal_clear/48px-Crystal_Clear_app_package_games.png', '2011-05-01', '00:00:00', 0, 0),
  34.         (2, 'Peliculas', 0, 0, 'Bla bla', 'png/movie.png', '2011-05-01', '00:00:00', 0, 0),
  35.         (3, 'Imformacion', 0, 0, '', 'cristal_clear/48px-Crystal_Clear_app_kedit.png', '2011-05-01', '00:00:00', 0, 0),
  36.         (4, '', 1, 1, 'Accion', '', '2011-05-01', '00:00:00', 0, 0),
  37.         (5, '', 1, 1, 'Aventura', '', '2011-05-01', '00:00:00', 0, 0),
  38.         (6, 'Herramientas', 0, 0, '', 'cristal_clear/48px-Crystal_Clear_action_configure.png', '2011-05-01', '00:00:00', 0, 0),
  39.         (7, 'Deportes', 0, 0, '', 'cristal_clear/48px-Crystal_Clear_app_clicknrun.png', '2011-05-01', '22:38:51', 0, 0),
  40.         (8, '', 1, 7, 'Atletismo', '', '2011-05-01', '22:41:08', 0, 0);
  41.        
  42.        
  43.         CREATE TABLE IF NOT EXISTS `noticiasv` (
  44.           `id` int(11) NOT NULL AUTO_INCREMENT,
  45.           `idc` int(11) NOT NULL,
  46.           `Titulo` varchar(60) NOT NULL,
  47.           `Byid` int(11) NOT NULL,
  48.           `fecha` date NOT NULL,
  49.           `NoticiaV` longtext NOT NULL,
  50.           `NT_COMENT_OF` int(11) NOT NULL,
  51.           `Byname` text NOT NULL,
  52.           `NT_TIME` time NOT NULL,
  53.           `pb_coments` int(11) NOT NULL,
  54.           `pb_visitas` int(11) NOT NULL,
  55.           `pb_tags` text NOT NULL,
  56.           PRIMARY KEY (`id`)
  57.         ) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=36 ;
  58.        
  59.         CREATE TABLE IF NOT EXISTS `noticias_coment` (
  60.           `cm_id` int(11) NOT NULL AUTO_INCREMENT,
  61.           `cm_indexid` int(11) NOT NULL,
  62.           `cm_byid` int(11) NOT NULL,
  63.           `cm_byname` text NOT NULL,
  64.           `cm_comentario` longblob NOT NULL,
  65.           `cm_date` date NOT NULL,
  66.           `cm_time` time NOT NULL,
  67.           PRIMARY KEY (`cm_id`)
  68.         ) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=21 ;
  69.        
  70.    
  71.         CREATE TABLE IF NOT EXISTS `nt_votem` (
  72.           `nt_vtid` int(11) NOT NULL AUTO_INCREMENT,
  73.           `nt_vtindex` int(11) NOT NULL,
  74.           `nt_vtname` text NOT NULL,
  75.           `nt_vtvalue` int(11) NOT NULL,
  76.           `vt_vttitle` text NOT NULL,
  77.           PRIMARY KEY (`nt_vtid`),
  78.         ) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=22 ;
  79.        
  80.            
  81.         CREATE TABLE IF NOT EXISTS `stadisticas_info` (
  82.           `si_id` int(11) NOT NULL AUTO_INCREMENT,
  83.           `si_ftid` int(11) NOT NULL,
  84.           `si_byid` int(11) NOT NULL,
  85.           `si_fecha` date NOT NULL,
  86.           `si_hora` time NOT NULL,
  87.           `si_fromid` int(11) NOT NULL,
  88.           PRIMARY KEY (`si_id`)
  89.         ) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=391 ;
  90.        
  91.         CREATE TABLE IF NOT EXISTS `usuariosv` (
  92.           `us_id` int(11) NOT NULL AUTO_INCREMENT,
  93.           `us_nombre_us` text NOT NULL,
  94.           `us_nombre` text NOT NULL,
  95.           `us_apellido` text NOT NULL,
  96.           `us_fecha_nc` date NOT NULL,
  97.           `us_reg_fech` date NOT NULL,
  98.           `us_mail` varchar(30) NOT NULL,
  99.           `us_noticias_p` int(11) NOT NULL DEFAULT '0',
  100.           `us_comentarios_p` int(11) NOT NULL DEFAULT '0',
  101.           `us_password` text NOT NULL,
  102.           `us_rank` int(11) NOT NULL DEFAULT '0',
  103.           `us_img` varchar(100) NOT NULL DEFAULT 'Notimg-perfil.jpg',
  104.           `us_state` int(11) NOT NULL DEFAULT '0',
  105.           `us_reason` text NOT NULL,
  106.           `us_plivase` varchar(200) NOT NULL DEFAULT 'fech:0:cor:0:',
  107.           `us_pais` int(11) NOT NULL,
  108.           `us_provincia` text NOT NULL,
  109.           `us_localidad` text NOT NULL,
  110.           `us_sex` text NOT NULL,
  111.           `us_code` text not null,
  112.           PRIMARY KEY (`us_id`)
  113.         ) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=3 ;
  114.        
  115.            
  116.         CREATE TABLE IF NOT EXISTS `us_msg` (
  117.           `msg_id` int(11) NOT NULL AUTO_INCREMENT,
  118.           `msg_byid` int(11) NOT NULL,
  119.           `msg_sendid` int(11) NOT NULL,
  120.           `msg_byname` text NOT NULL,
  121.           `msg_sendname` text NOT NULL,
  122.           `msg_fecha` date NOT NULL,
  123.           `msg_time` time NOT NULL,
  124.           `msg_view` int(11) NOT NULL,
  125.           `msg_titulo` text NOT NULL,
  126.           `msg_msg` longtext NOT NULL,
  127.           `msg_delt` tinyint(1) NOT NULL DEFAULT '0',
  128.           `msg_deltfrom` tinyint(1) NOT NULL DEFAULT '0',
  129.           PRIMARY KEY (`msg_id`)
  130.         ) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=28 ;   ");
  131.     }
  132. }
  133.  
  134. function session_state($id = 0){
  135.     if($id == 1){
  136.         if(empty($_SESSION['us_state'])){
  137.             echo "<meta http-equiv='Refresh' content='0;url=error.php'>";
  138.         }
  139.     }
  140.     else if($id == 0){
  141.         if(!empty($_SESSION['us_state'])){
  142.             echo "<meta http-equiv='Refresh' content='0;url=index.php'>";
  143.         }
  144.     }
  145. }?>
El error esta sobre function Session y el otro en la llave ?
Disculpen la molestia.
  #2 (permalink)  
Antiguo 06/05/2011, 11:25
Avatar de pateketrueke
Modernizr
 
Fecha de Ingreso: abril-2008
Ubicación: Mexihco-Tenochtitlan
Mensajes: 26.399
Antigüedad: 16 años
Puntos: 2534
Respuesta: ¿ Donde esta el problemas ?

El error te está indicando que de algún modo estas declarando dos veces la misma función, solo eso.

Por cierto, ¿escribes en árabe?
__________________
Y U NO RTFM? щ(ºдºщ)

No atiendo por MP nada que no sea personal.
  #3 (permalink)  
Antiguo 06/05/2011, 11:28
Avatar de Lautaro_eb  
Fecha de Ingreso: mayo-2010
Ubicación: Bariloche, Argentina
Mensajes: 284
Antigüedad: 13 años, 11 meses
Puntos: 24
Respuesta: ¿ Donde esta el problemas ?

Si me se que dise el error la funcion no se ah declarado dos veces ni se llama dos veces el include cualquier funcion que valla bajo de la linea 132 da ese error.
Un poco.
  #4 (permalink)  
Antiguo 06/05/2011, 11:39
Avatar de pateketrueke
Modernizr
 
Fecha de Ingreso: abril-2008
Ubicación: Mexihco-Tenochtitlan
Mensajes: 26.399
Antigüedad: 16 años
Puntos: 2534
Respuesta: ¿ Donde esta el problemas ?

Cita:
Iniciado por Lautaro_eb Ver Mensaje
Si me se que dise el error la funcion no se ah declarado dos veces ni se llama dos veces el include cualquier funcion que valla bajo de la linea 132 da ese error.
Un poco.
¿Entonces tu crees que PHP está inventando el mensaje de error?

No entiendo la renuencia, es tan claro, imposible no verlo.

Por favor, reflexiona.
__________________
Y U NO RTFM? щ(ºдºщ)

No atiendo por MP nada que no sea personal.
  #5 (permalink)  
Antiguo 06/05/2011, 11:44
 
Fecha de Ingreso: enero-2011
Ubicación: DF
Mensajes: 898
Antigüedad: 13 años, 2 meses
Puntos: 155
Respuesta: ¿ Donde esta el problemas ?

y si le cambias el nombre a la funcion?
__________________
No me interesan ni las gracias ni los karmas , pero si que se genere conocimiento, si se dio con la respuesta por favor confirmalo
  #6 (permalink)  
Antiguo 06/05/2011, 11:57
Avatar de pateketrueke
Modernizr
 
Fecha de Ingreso: abril-2008
Ubicación: Mexihco-Tenochtitlan
Mensajes: 26.399
Antigüedad: 16 años
Puntos: 2534
Respuesta: ¿ Donde esta el problemas ?

Cita:
Iniciado por mogurbon Ver Mensaje
y si le cambias el nombre a la funcion?
Seguro ocurre lo mismo, porque el problema no es la declaración de la función sino el lugar y tiempo exacto donde ésta se incluye.

Habrá incontables maneras de nombrar la función, pero sin saber donde ocurre la colisión el problema siempre será igual.
__________________
Y U NO RTFM? щ(ºдºщ)

No atiendo por MP nada que no sea personal.

Etiquetas: Ninguno
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 04:04.