Ver Mensaje Individual
  #3 (permalink)  
Antiguo 29/03/2007, 20:15
Avatar de mlorena
mlorena
 
Fecha de Ingreso: marzo-2007
Mensajes: 16
Antigüedad: 17 años, 1 mes
Puntos: 0
Pregunta Re: Problema... corre en Ie pero no en Firefox

Hola.. tienes razon..

Este es el boton, ahi mando llamar registro.

Código:
<input name="registrar" type="button" id="botones" class="botones" onClick="registro()" value="Registrar">
registro() es una funcion que esta en un archivo js llamado registro

Código:
		var XmlHttpRequest_Object = false; 
		
		if (window.XMLHttpRequest) 
		{
			XmlHttpRequest_Object = new XMLHttpRequest();
		} 
		else if (window.ActiveXObject) 
		{
			XmlHttpRequest_Object = new ActiveXObject("Microsoft.XMLHTTP");
		}
		
		function registro()
		{
			if(aprendeLore('0fvalida'))
			{
				var dataSource = "../Ajax_func/Registro.php";
				if(XmlHttpRequest_Object)
				{	
					XmlHttpRequest_Object.open("POST",dataSource, true);
					XmlHttpRequest_Object.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
					XmlHttpRequest_Object.onreadystatechange = function()
					{
						if( XmlHttpRequest_Object.readyState == 4 && XmlHttpRequest_Object.status == 200)
						{				
							var id = XmlHttpRequest_Object.responseText;
							if( id = "Done")
							{
								document.fvalida.submit();
							}
						}
					}//End of function
					XmlHttpRequest_Object.send( todo los campos que necesito);
				}//End of if validate null object			
			}
		}
Y por medio de AJAX (archivo Registro.php, si todo se llama registro jeje) tengo:

Código:
<?php
	session_start();
	session_cache_limiter('nocache, private');
	include("../TestCorreo.php");
	require_once("../admon/beans/DatabaseConnection.php");	
	$saludo = "Bienvenido!!! ";
	$nom 			= $_POST["nom"];
	$apepa 			= $_POST["apepa"];
	$apema 			= $_POST["apema"];
	$user 			= $_POST["user"];
	$direc 			= $_POST["dir"];
	$ciudad 		= $_POST["ciu"];
	$pais 			= $_POST["pais"];
	$postal 		= $_POST["cp"];	
	$dia 			= $_POST["dia"];	
	$mes 			= $_POST["mes"];	
	$anio 			= $_POST["anio"];	
	$correo 		= $_POST["mail"];	
	$civil 			= $_POST["civil"];	
	$preparacion 	= $_POST["preparacion"];	
	$ingreso 		= $_POST["ingreso"];	
	$peso 			= $_POST["peso"];	
	$altura			= $_POST["altura"];
	$demi 			= $_POST["demi"];	
	$genero 		= $_POST["genero"];	
	$zodiaco		= $_POST["zodiaco"];
	if($genero == "true")
	{
		$genero = "Mujer";
		$saludo = "Bienvenida!!! ";
	}
	else
	{
		$genero = "Hombre";
	}	
	$busco 			= $_POST["busco"];	
	if($busco == "true")
	{
		$busco = "Mujer";
	}
	else
	{
		$busco = "Hombre";
	}
	$deseo 			= $_POST["deseo"];	
	if($deseo == "1")
	{
		$deseo = "A";
	}
	else
	{
		$deseo = "B";
	}
  	$password = substr(eregi_replace("[^A-Z0-9]", "", md5(time())),0,7); //password
	$encryp = md5($password);//Encriptado
	try
	{
		$obj = new DatabaseConnection();
		$lnk = $obj->getConnection();
		if(!is_null($lnk))
		{
			$_SESSION['user'] = $user;
			$_SESSION['nombre'] = $row['Us_Nombre'];
			$query = "insert into soy_usuario ( Todos los campos que ocupo) values(Todas las variables con el valor que ocupo en tales campos);";
			$result = $lnk->query($query);
			if($result)
			{
				$html = '<html> <head> <meta http-equiv=Content-Type content=text/html; charset=iso-8859-1 />
<title>Untitled Document</title> 
<style type="text/css">
</style>
</head>
<body>
<p align=right>&nbsp;</p>
<table width=760px align=center>
<tr>
<td>
<table width=760px border=0 align=center>
  <tr>
    <td><div align=right style=color:#BF003F; font-size:24px; font-family:Lucida Sans>soy<span style=color:#F60>cupido</span><span class="style2">.com</span></div></td>
  </tr>
</table>
<table width=760px border=1 align=center bordercolor=#FFFFFF>
  <tr>
    <td><p align=justify>&nbsp;</p>
      <blockquote>
        <p align=justify style=font-family:Trebuchet MS; color:##003366 >Hemos recibido tu solicitud de ingreso, por lo que ahora te enviamos tu usuario y password para que puedas accesar.</p>
        <p align=justify style=font-family:Trebuchet MS; color:##003366>Tu usuario es: '.$user.'</p>
        <p align=justify style=font-family:Trebuchet MS; color:##003366>Tu password es: '.$password.'</p>
        <p align=justify style=font-family:Trebuchet MS; color:##003366>Cuando ingreses puedes cambiar el password por uno de tu agrado, &iquest;En donde?   Entra a <em>Modificar Mi Perfil</em> y ah&iacute; podras hacerlo. </p>
        <p align=center style=font-family:Trebuchet MS; color:#BF003F>Atte:</p>
        <p align=center style=font-family:Trebuchet MS; color:#BF003F>Administraci&oacute;n </p>
      </blockquote>      
	  </td>
  </tr>
</table>
</td>
</tr>
</table>
</body>
</html>';
				enviar_correo('[email protected]', $correo, $saludo. $nom, $html);
				echo('ne');
			}
			//mysqli_close($lnk);
		}
		else
		{
			throw new Exception ('Problemas con conexion',3);
			//echo('Conexion Nula');
		}
	}
	catch(Exception $E)
	{
		echo($E->getMessage());
	}

?>
Ya vi, que si es un boton simple que me liga a otra pagina no hay problema... el problema es cuando corre una funcion como en ingresar o cuando actualizo datos, das click y no hace nadita en firefox...
alguna idea??

gracias!!!!