Foros del Web » Programando para Internet » PHP »

problema con "stripslashes()"

Estas en el tema de problema con "stripslashes()" en el foro de PHP en Foros del Web. Emm... hace poco postee un mensaje, sobre que estaba haciendo una pagina de noticias y bueh... ese tema quedoo solucionado... Ahora tengo otro problema, cuando ...
  #1 (permalink)  
Antiguo 30/01/2009, 00:07
Avatar de bioxido  
Fecha de Ingreso: diciembre-2008
Ubicación: $_SERVER['PHP_SELF']
Mensajes: 601
Antigüedad: 15 años, 4 meses
Puntos: 21
problema con "stripslashes()"

Emm... hace poco postee un mensaje, sobre que estaba haciendo una pagina de noticias y bueh... ese tema quedoo solucionado...


Ahora tengo otro problema, cuando uso stripslashes() para emmm "filtrar" (?) la informacion que obtengo de la base de datos... me lee solo la ultima noticia en la base de datos..

Emmm... digamos, que usando stripslashes solo puedo tomar 1 sola noticia de la DB...

Aca un ejemplo...

Aqui estoy usando stripslashes, y se ve 1 sola noticia, por mas que este LIMIT en 5

http://worldanime.tv/emi/db/sasa.php

Aqui no estoy usando stripshashes, y se ven las 5 noticias, pero claro... se ven mal, por que no estoy usando stripslashes xD

http://worldanime.tv/emi/db/sasa2.php

Los codigos son...

Esta con stripslashes:

Código PHP:
<head>

<?
$dbhost 
"XXXXXX";
$dbuname "XXXXXXX";
$dbpass "XXXXXXXXXX";
$dbname "XXXXXXXXXX";

$link mysql_connect$dbhost$dbuname$dbpass) or die ( "Error Conectando a La Bases De Datos.");
mysql_select_db$dbname,$link ) or die ("Error Seleccionando La Base De Datos.");

$result mysql_query("SELECT title,time,hometext FROM nuke_stories ORDER BY nuke_stories.sid DESC LIMIT 5"$link);

while (
$row mysql_fetch_array($result))

$hometext stripslashes($row['hometext']);


{


?>
</head>

<body>
<table  align="center" width="72%" height="41">
<title>Prueba</title><td width="100%" background="http://i286.photobucket.com/albums/ll96/bioxido8/1421351-2.jpg" height="27">
  <? echo '<font color="#ffffff" face="Arial" size="4">'.$row[title]. '</font>';?>  </div></td>
</table>
</table>
<td width="100%" bacjgriybd="#c9c9c9"><div align="center"><font color="#000000" face="Arial" size="2">
      <? echo  $hometext ;
        }
     
?>
     
  </div></font></div></td>
</table>
</body>
Y esta sin stripslashes....

Código PHP:
<head>

<?
$dbhost 
"SSSSSSS";
$dbuname "SSSSSS";
$dbpass "SSSSSS";
$dbname "SSSSSSSSSSS";

$link mysql_connect$dbhost$dbuname$dbpass) or die ( "Error Conectando a La Bases De Datos.");
mysql_select_db$dbname,$link ) or die ("Error Seleccionando La Base De Datos.");

$result mysql_query("SELECT title,time,hometext FROM nuke_stories ORDER BY nuke_stories.sid DESC LIMIT 0 , 5"$link);

while (
$row mysql_fetch_array($result))

{


?>
</head>

<body>
<table  align="center" width="72%" height="41">
<title>Prueba</title><td width="100%" background="http://i286.photobucket.com/albums/ll96/bioxido8/1421351-2.jpg" height="27">
  <div align="center"><? echo '<font color="#ffffff" face="Arial" size="4">'.$row[title]. '</font>';?>  </div></td>
</table>
</table>
<td width="100%" bacjgriybd="#c9c9c9">
      <? echo '<div align="center"><font color="#000000" face="Arial" size="2">' .$row[hometext]. '</font></div>'
    }
     
?>
  </div></td>
</table>
</body>
Agradezco su ayuda ^^
  #2 (permalink)  
Antiguo 30/01/2009, 00:50
Avatar de pato12  
Fecha de Ingreso: septiembre-2007
Ubicación: Salta
Mensajes: 1.620
Antigüedad: 16 años, 7 meses
Puntos: 101
Respuesta: problema con "stripslashes()"

Hola,
Prueba con:
Código PHP:
<head> 

<? 
$dbhost 
"XXXXXX"
$dbuname "XXXXXXX"
$dbpass "XXXXXXXXXX"
$dbname "XXXXXXXXXX"

$link mysql_connect$dbhost$dbuname$dbpass) or die ( "Error Conectando a La Bases De Datos."); 
mysql_select_db$dbname,$link ) or die ("Error Seleccionando La Base De Datos."); 

$result mysql_query("SELECT title,time,hometext FROM nuke_stories ORDER BY nuke_stories.sid DESC LIMIT 0 , 5"$link); // intenta con 0 , 5 enves de 5 

while ($row mysql_fetch_array($result))
// deve ir antes que la otra linea

$hometext stripslashes($row['hometext']); 


?> 
</head> 

<body> 
<table  align="center" width="72%" height="41"> 
<title>Prueba</title><td width="100%" background="http://i286.photobucket.com/albums/ll96/bioxido8/1421351-2.jpg" height="27"> 
  <? echo '<font color="#ffffff" face="Arial" size="4">'.$row[title]. '</font>';?>  </div></td> 
</table> 
</table> 
<td width="100%" bacjgriybd="#c9c9c9"><div align="center"><font color="#000000" face="Arial" size="2"> 
      <? echo  $hometext 
        } 
     
?>
Suerte
Salu2
__________________
Half Music - www.halfmusic.com
  #3 (permalink)  
Antiguo 30/01/2009, 14:56
Avatar de bioxido  
Fecha de Ingreso: diciembre-2008
Ubicación: $_SERVER['PHP_SELF']
Mensajes: 601
Antigüedad: 15 años, 4 meses
Puntos: 21
De acuerdo Respuesta: problema con "stripslashes()"

ah, dios... que error tan tonto xD me da verguenza jajaja....

Bueno, muchas gracias ^^ ahora puedo empezar con el nuevo index XD
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 22:33.