ahy va entonces, yo con tando codigo asi junto yame mareo je
Código HTML:
Ver original<form name='sms' method='GET' action='' onsubmit='enviosmspriva(); return false'>
<input type='hidden' name='idremi' value='".$_REQUEST['idremi']."' /> <input type='hidden' name='iddes' value='".$_REQUEST['iddes']."' />
<input type='submit' name='mand' value='Enviar mensaje' onclick='prehideSms()' />
el formulario llama mediante javascrpt a este otro
Código HTML:
Ver originalfunction objetoAjax(){
var xmlhttp=false;
try {
xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
try {
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
} catch (E) {
xmlhttp = false;
}
}
if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
xmlhttp = new XMLHttpRequest();
}
return xmlhttp;
}
function enviosmspriva(){
divResultado = document.getElementById('preloadSmsB');
id1=document.smspriva.iddes.value;
id2=document.smspriva.idremi.value;
//instanciamos el objetoAjax
ajax=objetoAjax();
ajax.open("POST", "ajaxsms.php",true);
ajax.onreadystatechange=function() {
if (ajax.readyState==4) {
divResultado.innerHTML = ajax.responseText
LimpiarCampos();
}
}
ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded"); exit;
ajax.send("iddes="+id1+"&idremi="+id2)
}
//función para limpiar los campos
function LimpiarCampos(){
document.smspriva.id1.value="";
document.smspriva.id2.value="";
}
y de ahy vamos ahy
Código PHP:
Ver original$idDes = $_REQUEST['id1'];
$docum = $_REQUEST['id2'];
$kten ="select $conce from privados where idusuario='$idDes' limit 1";
conecion a bd.........
//miro si biene o no vacia
$existe='0';
}
if($existe!='1'){
//si viene vacia
$metosms ="insert into privado ......
}else{
//si no viene vacia
$metosms ="update privado set .......
}