|    
			
				15/04/2010, 15:17
			
			
			  | 
  |   |  |  |  Fecha de Ingreso: noviembre-2009 
						Mensajes: 112
					 Antigüedad: 15 años, 11 meses Puntos: 0 |  | 
  |  Respuesta: pasar datos de un php al mismo php por ajax  
  este es ejemplillo.php
 <?php
 
 $array1 = $_POST["array1"];
 $i = $_POST["i"];
 echo($array1.$i);
 ?>
 <html>
 <head>
 <script src="ejemplo.js"></script>
 </head>
 <body>
 <form id="form1" name="form1">
 
 <input type="button" name="registrarse" id="registrarse" value="registrarse" onclick="cargarContenido()"/>
 <div align="center" id="divRegistrar" class="rojo"></div>
 <input type="hidden" id="array1" value="<?php echo($array1);?>" />
 <input type="hidden" id="i" value="<?php echo($i);?>" />
 
 </form>
 
 </body>
 </html>
 
 
 y el archivo ejemplo.js es el siguiente:
 
 function cargarContenido(){
 
 var array1 = document.getElementById("array1").value;
 var i = document.getElementById("i").value;
 
 
 i = parseInt(i)+5;
 
 ajax = objetoAjax();
 ajax.open("POST", "ejemplillo.php",true);
 ajax.onreadystatechange=function()
 {
 if (ajax.readyState==4) {
 document.getElementById("divRegistrar").innerHTML = ajax.responseText;
 }
 }
 ajax.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
 ajax.send("array1="+array1+"&i="+i);
 
 }
 
 
 Lo que me pasa es que cuando entro a ejemplillo.php ps me sale el boton "registrarse" (hasta hy bn), pero cuando le doy click me salen el botón "registrarse" de antes, los resultados y el otro botón
 
 Como quito el boton de antes solo necesito que me muestre el los resultados y el botón, no q me muetsre además el botón de antes
 
 Gracias
     |