Ver Mensaje Individual
  #8 (permalink)  
Antiguo 18/10/2008, 17:51
Avatar de pato12
pato12
 
Fecha de Ingreso: septiembre-2007
Ubicación: Salta
Mensajes: 1.620
Antigüedad: 16 años, 7 meses
Puntos: 101
Respuesta: Sacar saltos de linea

Hola,
Haci los inserto:
Código PHP:
$cansion=nl2br(addslashes(htmlentities(strip_tags($_POST['half_cansion']))));
if(
$cansion==""){
echo 
"La canción esta vacía.";
}elseif(empty(
$_POST['half_titulo'])){
echo 
"Titulo vacío, es un campo obligatorio.";
}else{
$album=($_POST['half_albun']=="")? "Desconocido" :trim(addslashes(htmlentities(strip_tags(ucfirst(strtolower($_POST['half_albun']))))));
$artista=($_POST['half_artista']=="")? "Desconocido" :trim(addslashes(htmlentities(strip_tags(ucfirst(strtolower($_POST['half_artista']))))));
$campos=array('artista','cansion','titulo','votos','votos_s','albun','ip','leidas','letra','por');
$datos=array($artista,$cansion,trim(addslashes(htmlentities(strip_tags(ucfirst(strtolower($_POST['half_titulo'])))))),'0','0',$album,$_SERVER['REMOTE_ADDR'],'0',substr($_POST['half_titulo'],0,1),$_SESSION['login_half']);
$c=implode(',',$campos);
$d='\''.implode("','",$datos).'\'';
$sSQL=@sprintf("INSERT INTO %s (%s) VALUES (%s)","cansiones",$c,$d);
$query = @mysql_query($sSQL);

Gracias
Salu2
__________________
Half Music - www.halfmusic.com