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