mi problema es que cuando envio los datos por ajax, en la base de datos me aparece en la fila titulo UNDEFINED. Este es mi codigo ajax:
var idt=document.getElementById('idnoticia').value;
var cmn=document.getElementById('comentariont').value;
var de=document.getElementById('de').value;
var ttl=document.getElementById('titulo').value;
cad='idnoticia='+encodeURIComponent(idt)+'&comentariont='+encodeURIComponent(cmn)+'&de='+encodeURIComponent(de)+'&titulo='+encodeURIComponent(ttl); return cad;
}var conexion1;
function enviarFormulario()
{
conexion1=crearXMLHttpRequest();
conexion1.onreadystatechange = procesarEventos;
conexion1.open('POST',
'comentario.php',
true);
conexion1.setRequestHeader("Content-Type",
"application/x-www-form-urlencoded");
conexion1.send(retornarDatos());
}function procesarEventos()
y este es donde mando los datos:
$notifi=mysql_query("INSERT INTO notificaciones(id_de,de,para,id_noticia,titulo,fecha,leido,tipo)VALUES('$_SESSION[id]','$_SESSION[nick]','$_REQUEST[de]','$_REQUEST[idnoticia]','$_REQUEST[titulo]','$fecha',NULL,''$_REQUEST[tipo]')",$conexion)or
die("Error en notificaciones ".mysql_error());
espero y me puedan ayudar.SALUDOS
Es por que el elemento id titulo no esta definido.. mira tu codigo html.
Pues lo veo bien definido, o no?<form action="" method="post" id="noticiaid">
<input type="text" name="titulo" id="titulo" value="<?php echo $titulo; ?>">
<input type="text" name="de" id="de" value="<?php echo $ntde; ?>" >
<textarea name="comentariont" id="comentariont" class="comentnot" style="width:450px;height:50px" placeholder="Comenta..."></textarea><br>
<input type="submit" value="Comentar" id="enviar" style="background:#4AB0BC;cursor:pointer;" class="btsb">