este es el error
Cita:
En la linea 432 esta el headerWarning: Cannot modify header information - headers already sent by (output started at C:\AppServ\www\empresanet\registro empresas\index.php:242) in C:\AppServ\www\empresanet\registro empresas\index.php on line 432
Código PHP:
if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form1")) {
if (isset($_POST["cod_poblacion"])){
$cod_poblacion2=$_POST['cod_poblacion'];
mysql_select_db($database_conexion, $conexion);
$query_poblacion_pos2 = "SELECT * FROM t_municipios WHERE id_municipio =".$cod_poblacion2."";
$poblacion_pos2 = mysql_query($query_poblacion_pos2, $conexion) or die("Error en la consulta");
$row_poblacion_pos2 = mysql_fetch_assoc($poblacion_pos2);
$totalRows_poblacion_pos2 = mysql_num_rows($poblacion_pos2);
$cod_postal = $row_poblacion_pos2['cod_postal'];
$_POST['cod_postal']= $cod_postal;
$_POST['fecha_alta']=date("Y-m-d");
}
$insertSQL = sprintf("INSERT INTO empresas_tbl (empresa, direccion, poblacion, cp, provincia, telefono1, telefono2, fax, email, cifnif, web, persona_contacto, titulo, texto, logotipo, img1, img2, familia, subfamilia, subsubfamilia, fecha_alta) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s,%s, %s, %s, %s)",
GetSQLValueString($_POST['empresa'], "text"),
GetSQLValueString($_POST['direccion'], "text"),
GetSQLValueString($_POST['cod_poblacion'], "text"),
GetSQLValueString($_POST['cod_postal'], "text"),
GetSQLValueString($_POST['cod_provincia'], "text"),
GetSQLValueString($_POST['telefono1'], "text"),
GetSQLValueString($_POST['telefono2'], "text"),
GetSQLValueString($_POST['fax'], "text"),
GetSQLValueString($_POST['email'], "text"),
GetSQLValueString($_POST['cifnif'], "text"),
GetSQLValueString($_POST['web'], "text"),
GetSQLValueString($_POST['persona_contacto'], "text"),
GetSQLValueString($_POST['titulo'], "text"),
GetSQLValueString($_POST['texto'], "text"),
GetSQLValueString($_POST['logotipo'], "text"),
GetSQLValueString($_POST['img1'], "text"),
GetSQLValueString($_POST['img2'], "text"),
GetSQLValueString($_POST['cod_familia'], "int"),
GetSQLValueString($_POST['cod_subfamilia'], "int"),
GetSQLValueString($_POST['cod_subsubfamilia'], "int"),
GetSQLValueString($_POST['fecha_alta'], "date"));
mysql_select_db($database_conexion, $conexion);
$Result1 = mysql_query($insertSQL, $conexion) or die(mysql_error());
}
header("location:insercion_ok.php");
}