Foros del Web » Programando para Internet » PHP »

Problemas con mi web (beta)

Estas en el tema de Problemas con mi web (beta) en el foro de PHP en Foros del Web. Hola! Estoy realizando mi página. Va a ser un colegio, con usuarios que se registran, ganan puntos y hablan por un tagboard. Pero tengos errores, ...
  #1 (permalink)  
Antiguo 26/06/2008, 11:13
 
Fecha de Ingreso: febrero-2008
Mensajes: 58
Antigüedad: 16 años, 2 meses
Puntos: 0
Problemas con mi web (beta)

Hola!
Estoy realizando mi página. Va a ser un colegio, con usuarios que se registran, ganan puntos y hablan por un tagboard.
Pero tengos errores, que aunque arregle lo que dice... no funciona.
El primer problema es cuando intento instalar las tablas de forma automática.
Código PHP:
<?
if($_GET[accion] == "reparar"){

$configuracion "no";
$instalando "si";
include(
"config.php");

if(
mysql_query("DROP TABLE IF EXISTS usuarios")){
    echo
"<font size=2>Tabla <b>usuarios</b> reparada con éxito<br></font>";
} else {
    echo
"<font size=2>Error al borrar la tabla <b>usuarios</b>, es posible que no se haya instalado y es donde este el problema.<br></font>";
}
if(
mysql_query("DROP TABLE IF EXISTS configuracion")){
    echo
"<font size=2>Tabla <b>configuracion</b> reparada con éxito<br></font>";
} else {
    echo
"<font size=2>Error al borrar la tabla <b>configuracion</b>, es posible que no se haya instalado y es donde este el problema.<br></font>";
}
if(
mysql_query("DROP TABLE IF EXISTS puntos")){
    echo
"<font size=2>Tabla <b>puntos</b> reparada con éxito<br></font>";
} else {
    echo
"<font size=2>Error al borrar la tabla <b>puntos</b>, es posible que no se haya instalado y es donde este el problema.<br></font>";
}
if(
mysql_query("DROP TABLE IF EXISTS enlinea")){
    echo
"<font size=2>Tabla <b>enlinea</b> reparada con éxito<br></font>";
} else {
    echo
"<font size=2>Error al borrar la tabla <b>enlinea</b>, es posible que no se haya instalado y es donde este el problema.<br></font>";
}
if(
mysql_query("DROP TABLE IF EXISTS mensajes")){
    echo
"<font size=2>Tabla <b>mensajes</b> reparada con éxito<br></font>";
} else {
    echo
"<font size=2>Error al borrar la tabla <b>mensajes</b>, es posible que no se haya instalado y es donde este el problema.<br></font>";
}

} else {
if(
$_POST[instalar]){

$configuracion "no";
$instalando "si";
include(
"config.php");

$ip $REMOTE_ADDR;
$fecha time();
$contrasena $_POST[pass];
$casa "Ninguna";

$sql1 "CREATE TABLE configuracion (
administrador varchar(5) not null,
idioma varchar(50) not null,
puntos varchar(5) not null,
pagina varchar(200) not null,
get varchar(50) not null,
estilo varchar(100) not null,
preg varchar(5) not null
);"
;

$sql2 "CREATE TABLE puntos (
id smallint(10) unsigned not null auto_increment,
texto text not null,
pagina varchar(100) not null,
minimo varchar(10) not null,
primary key(id)
);"
;

$sql3 "CREATE TABLE `usuarios` (
  `id` smallint(5) unsigned NOT NULL auto_increment,
  `fecha_registrado` int(10) unsigned NOT NULL,
  `nick` varchar(20) NOT NULL default '',
  `contrasena` varchar(32) NOT NULL default '',
  `email` varchar(40) NOT NULL default '',
  `pais` varchar(20) NOT NULL default '',
  `sexo` enum('0','1') NOT NULL default '0',
  `descripcion` tinytext NOT NULL,
  `ip` varchar(15) NOT NULL default '',
  `visit` varchar(15) NOT NULL default '',
  `avatar` varchar(100) NOT NULL default '',
  `web` varchar(100) NOT NULL default '',
  `nombre` varchar(20) NOT NULL default '',
  `conectado` int(10) NOT NULL default '0',
  `boletin` varchar(20) NOT NULL default '',
  `profesor` varchar(200) NOT NULL,
  `perin` varchar(2) NOT NULL,
  `casa` varchar(200) NOT NULL,
  `soleys` varchar(200) NOT NULL,
  `categoria` varchar(200) NOT NULL,
  `mostrarm` varchar(5) NOT NULL default '',
  `puntos` varchar(20) NOT NULL default '',
  `n_dia` varchar(5) NOT NULL default '',
  `n_mes` varchar(5) NOT NULL default '',
  `n_ano` varchar(5) NOT NULL default '',
  `baneado` varchar(5) NOT NULL default '',
  `firma` text NOT NULL,
  PRIMARY KEY  (`id`),
  KEY `nick` (`nick`,`email`),
  FULLTEXT KEY `nick_2` (`nick`)
);"
;

$sql4 "CREATE TABLE mensajes (
   id smallint(5) unsigned NOT NULL auto_increment,
   nuevo tinyint(1) unsigned DEFAULT '0' NOT NULL,
   fecha int(10) unsigned DEFAULT '0' NOT NULL,
   remitente varchar(20) NOT NULL,
   destinatario varchar(20) NOT NULL,
   mensaje text NOT NULL,
   asunto varchar(255) NOT NULL,
   PRIMARY KEY (id),
   KEY destinatario (destinatario)
);"
;

$sql5 "INSERT INTO usuarios (nick,contrasena,email,ip,puntos,fecha,casa,perin) VALUES ('$_POST[nick]','$contrasena','$_POST[email]','$ip','0','$fecha','$casa'),'si';";

$sql6 "INSERT INTO configuracion (administrador,idioma,estilo,pagina,get,puntos,preg) VALUES ('1','$_POST[idioma]','$_POST[estilo]','index.php','stairs','$_POST[puntos]','0');";

$sql7 "CREATE TABLE enlinea (
    ip varchar(20) not null,
    usuario varchar(50) not null,
    fecha varchar(20) not null,
    tipo varchar(50) not null
);"
;

$sql8 "CREATE TABLE tagboard (
    fecha varchar(20) not null,
    usuario varchar(50) not null,
    contenido varchar(150) not null,
    id smallint(5) unsigned NOT NULL auto_increment
   PRIMARY KEY (id),
);"
;

$sql9 "CREATE TABLE pensamientos (
    nick varchar(20) not null,
    comentario text NOT NULL,
    fecha varchar(20) not null,
    titulo varchar(20) not null,
    id smallint(5) unsigned NOT NULL auto_increment
   PRIMARY KEY (id),
);"
;

$sq20 "CREATE TABLE casas (
    nombre varchar(20) not null,
    puntos varchar(10) not null,
    id smallint(1) unsigned NOT NULL auto_increment,
    cant varchar(30) not null,
    puesto varchar(1) not null
   PRIMARY KEY (id),
);"
;

$sq21 "CREATE TABLE chamanes (
    id smallint(5) unsigned NOT NULL auto_increment
    titulo varchar(40) not null,
    short varchar(60) not null,
    full text NOT NULL,
    fecha int(10) unsigned DEFAULT '0' NOT NULL,
    reportero varchar(20) not null,
    categoria varchar(20) not null,
    idr varchar(5) not null
);"
;

$sq22 "CREATE TABLE comentarios (
    idnoticia varchar(5) not null,
    fecha varchar(20) not null,
    comentario text NOT NULL,
    autor varchar(20) not null,
);"
;

$sq23 "CREATE TABLE biblioteca (
    id smallint(5) unsigned NOT NULL auto_increment,
    titulo varchar(40) not null,
    autor varchar(20) not null,
    contenido text NOT NULL,
    fecha int(10) unsigned DEFAULT '0' NOT NULL,
    descripcion varchar(60) not null,
    categoria varchar(20) not null,
    per varchar(1) not null,
    ida varchar(5) not null,
);"
;

if(
mysql_query($sql1) && mysql_query($sql2) && mysql_query($sql3) && mysql_query($sql4) && mysql_query($sql5) && mysql_query($sql6) && mysql_query($sql7) && mysql_query($sql8) && mysql_query($sql9) && mysql_query($sq20) && mysql_query($sq21) && mysql_query($sq22) && mysql_query($sq23)){

echo (
"Se ha instalado bien.") } else {

echo(
"Ocurrió un error.");

}

} else {
?>
<body>
<form name="form1" method="post" action="">
  <table width="500"  border="0" cellpadding="3" cellspacing="0" bgcolor="#dddddd" style="border: 1px #000000 solid; ">
    <tr class="normal">
      <td width="140"><strong>Nick admin: </strong></td>
      <td width="348"><input name="nick" type="text" id="nick" size="30"></td>
    </tr>
    <tr class="normal">
      <td><strong>Contrase&ntilde;a admin: </strong></td>
      <td><input name="pass" type="password" id="pass" size="30"></td>
    </tr>
    <tr class="normal">
      <td><strong>E-mail admin: </strong></td>
      <td><input name="email" type="text" id="email" size="30"></td>
    </tr>
    <tr class="normal">
      <td><strong>Idioma:</strong></td>
      <td><select name="idioma" id="idioma">
      <?
              $dir 
opendir("idiomas");
            while(
$file readdir($dir)){
            if(
$file != "." && $file != ".."){
                        
?>
              <option value="<?=$file?><? if($file == "espanol.php"){ echo"selected"; } ?>><?=$file?></option>
              <? } } ?>
      </select></td>
    </tr>
    <tr class="normal">
      <td><strong>Estilo:</strong></td>
      <td><select name="estilo" id="estilo">
            <?
              $dir 
opendir("estilos");
            while(
$file readdir($dir)){
            if(
$file != "." && $file != ".."){
                        
?>
              <option value="<?=$file?><? if($file == "default.php"){ echo"selected"; } ?>><?=$file?></option>
              <? } } ?>
      </select></td>
    </tr>
    <tr class="normal">
      <td><strong>Sistema de puntos: </strong></td>
      <td><select name="puntos" id="puntos">
          <option value="si" selected>Si</option>
          <option value="no">No</option>
      </select></td>
    </tr>
    <tr class="normal">
      <td>&nbsp;</td>
      <td>&nbsp;</td>
    </tr>
    <tr class="normal">
      <td>&nbsp;</td>
      <td><input name="instalar" type="submit" id="instalar" value="Instalar">
          <input type="reset" name="Submit" value="Restablecer"></td>
    </tr>
  </table>
  <p class="normal">Copyright 2008 colegiohelvort.com </p>
</form>
<p class="normal">&nbsp; </p>
<? }
}
 
?>
Pues, cuando pongo los datos para iniciar seción y todo.. no entra a la base de datos.
En el config.php puse:
Código PHP:
                $host "colegiohelvort.com:2086"

    
$user "USER"

    
$pass "CLAVE"

    
$db   "BASEDEDATOS"

    
$dirw "http://www.colegiohelvort.com/"
Qué puede estar mal???
  #2 (permalink)  
Antiguo 26/06/2008, 11:24
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: Problemas con mi web (beta)

Hola Tinger,

Sería más fácil para todos si nos dijeras que problema en especifico tienes.

Saludos.
  #3 (permalink)  
Antiguo 26/06/2008, 11:33
 
Fecha de Ingreso: febrero-2008
Mensajes: 58
Antigüedad: 16 años, 2 meses
Puntos: 0
Respuesta: Problemas con mi web (beta)

Es que no sé qué pasa...
Cuando pongo en Instalar cagra... unos minutos y luego aparece una pag en blanco.
Cunado me fijo en la Base de Datos no hay nada: no se instaló.
Creo uqe es un problema en donde pido carga a la base de datos....
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:35.