require_once('./inc/db.inc.php'); $email = $_POST['email']; $envia = $_POST['envia']; $error = $_GET['error']; switch($error){ case 1: $error = "Ha de rellenar los campos obligatorios."; break; case 2: $error = "Escriba una dirección de e-Mail correcta."; break; }//end switch error //tienes que buscar en las dos tablas if($envia){ $sqluser3 = "SELECT `password` FROM empresas WHERE `email` = '".$email."'"; $rsuser3 = mysql_query ($sqluser3) or die ("Invalid query USER3 empresa"); $i3=0; while($user3 = mysql_fetch_array($rsuser3)){ $pass3 = $user3[password]; $i3++; } $sqluser4 = "SELECT `password` FROM particulares WHERE `email` = '".$email."'"; $rsuser4 = mysql_query ($sqluser4) or die ("Invalid query USER4 particulares"); $i4=0; while($user4 = mysql_fetch_array($rsuser4)){ $pass4 = $user4[password]; $i4++; } $passw = 0; if($i3 != 0){ $passw = $pass3; } if($i4 != 0){ $passw = $pass4; } if($i3 != 0 || $i4 != 0){ include("./includes/recuperapass.php"); } } ?>