1. Por un lado tengo un div que carga un php mediante js, que quiero que carge otro php en otro div interior, o sea anidados. Mi problema se presenta pq adentro del div padre muestro por html una tabla la cual tiene un campo a llenar por goles (mundial sudafrica) y tengo que pasar por post un array con los datos insertados. Para ello uso un js que no se si esta bien pues no lo escribi yo..
Código:
Ok, el fragmento de codigo de mi php es el siguiente:<script type="text/javascript">
//<script>
function objetus(file) {
xmlhttp=false;
this.AjaxFailedAlert = "Su navegador no soporta las funciónalidades de este sitio y podria experimentarlo de forma diferente a la que fue pensada.Por favor habilite javascript en su navegador para verlo normalmente.\n";
this.requestFile = file;
this.encodeURIString = true;
this.execute = false;
if (window.XMLHttpRequest) {
this.xmlhttp = new XMLHttpRequest();
if (this.xmlhttp.overrideMimeType) {
this.xmlhttp.overrideMimeType('text/xml');
}
}
else if (window.ActiveXObject) { // IE
try {
this.xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
}catch (e) {
try {
this.xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
} catch (e) {
this.xmlhttp = null;
}
}
if (!this.xmlhttp && typeof XMLHttpRequest!='undefined') {
this.xmlhttp = new XMLHttpRequest();
if (!this.xmlhttp){
this.failed = true;
}
}
}
return this.xmlhttp ;
}
function recibeid(_pagina,valorget,valorpost,capa){
ajax=objetus(_pagina);
if(valorpost!=""){
ajax.open("POST", _pagina+"?"+valorget+"&tiempo="+new Date().getTime(),true);
} else {
ajax.open("GET", _pagina+"?"+valorget+"&tiempo="+new Date().getTime(),true);
}
ajax.onreadystatechange=function() {
if (ajax.readyState==1){
document.getElementById(capa).innerHTML =
"<img src='loadingcircle.gif' align='center'> Aguarde por favor...";
}
if (ajax.readyState==4) {
if(ajax.status==200)
{document.getElementById(capa).innerHTML = ajax.responseText;}
else if(ajax.status==404)
{
capa.innerHTML = "La direccion no existe";
}
else
{
capa.innerHTML = "Error: ".ajax.status;
}
}
}
if(valorpost!=""){
ajax.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
ajax.send(valorpost);
} else {
ajax.send(null);
}
}
</script>
Código PHP:
<form method="post" onsubmit="return false" >
// Consulta Mysql para sacar datos... y luego el while para llenar tabla html.
while ($dato != null){
list($year, $month, $day) = explode("-", $dato[3]);
$date = date('d M, Y', mktime(0, 0, 0, $month, $day, $year));
//Lleno tabla de partidos
echo "<tr>";
$id_partido[$i]=$dato[0];
echo "<td><input name=\"datos[]\" type=\"hidden\" value=\"".$dato[0]."\"></td>";
echo "<td>"; echo "<img src=\"".$dato[9]."\"/>";echo "</td>";
echo "<td>";echo utf8_encode($dato[8]);echo "</td>";
echo "<td><input type=\"text\" name=\"datos[]\" size=\"1\" maxlength=\"2\" value=\"".$dato[14]."\" ".$activo."></td>";
echo "<td>"; echo "<img src=\"".$dato[12]."\"/>";echo "</td>";
echo "<td>";echo utf8_encode($dato[11]);echo "</td>";
echo "<td><input type=\"datos[]'\" name=\"datos[]\" size=\"1\" maxlength=\"2\" value=\"".$dato[15]."\" ".$activo."></td>";
echo "<td>";echo $dato[13];echo "</td>";
echo "<td>".$date."</td>";
echo "<td>";echo $dato[4];echo "</td>";
echo "</tr>";
$dato = mysql_fetch_row($result);
$i++;
}
echo "</table>";
<label>
<input type="submit" name="submit" value="Guardar" onClick="recibeid('./guardarDatos.php','',datos='datos[]','estado')">
</label>
<input name="Restablecer" type="reset" value="Limpiar">
</form>
Saludos
Pd: no se si este post esta bien ubicado pues es mi primer post.. espero alguien me pueda ayudar.. Saludos
solucionado...


