Mételo todo en el mismo formulario y en el php destino lo siguiente:
Código PHP:
<?php
$con = mysql_connect("localhost","user","pass");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("base_de_datos", $con);
$sql="INSERT INTO persona_fisica (apellido,nombre,direccion,numero_doc,telefono,celular,situacion,ciudad,cod_postal,mail)
VALUES
('$_POST[apellido]','$_POST[nombre]','$_POST[direccion]','$_POST[numero_doc]','$_POST[telefono]','$_POST[celular]','$_POST[situacion]','$_POST[ciudad]','$_POST[cod_postal]','$_POST[mail]')";
if (!mysql_query($sql,$con))
{
die('Error: ' . mysql_error());
}
//echo "1 record added";
$persona_id = mysql_insert_id($con);
if ($persona_id){
$sql = "INSERT INTO creditos (persona_id,credito_campo1,credito_campo2) VALUES ('".$persona_id."','".$_POST['credito_campo1']."','".$_POST['credito_campo2']."')";
if (!mysql_query($sql,$con))
{
die('Error: ' . mysql_error());
}
}
mysql_close($con);
header ("Location: index.php");
?>