Ver Mensaje Individual
  #1 (permalink)  
Antiguo 20/03/2013, 14:14
Avatar de trofserpiente
trofserpiente
 
Fecha de Ingreso: julio-2012
Ubicación: Lerida
Mensajes: 220
Antigüedad: 11 años, 9 meses
Puntos: 1
Exclamación problemas con header

bueno lo que pasa es que no me funciona el header ya que no llega donde le indico, y en vez de eso me lleva hasta el index

este es el codigo

Código PHP:
<?php

 $conexA
mysql_connect("$host","$user","$pass")
    or die(
"No se pudo realizar la conexion");
 
$conexBmysql_select_db("$db",$conexA)
    or die(
"ERROR con la base de datos");

if(isset(
$_POST['ok_pro']))
  {
    
$producto=$_POST['producto'];
    
$n_pv=$_POST['n_pv'];
    
$ref=$_POST['ref'];
    
$presentacion=$_POST['presentacion'];
    
$exis=$_POST['exis'];
    
$vu=$_POST['vu'];
    
$ingre=$_POST['ingre'];
    
$ingre2=substr($ingre,0,10);
    
$estado="Existente";
    
$n_fac=$_POST['n_fac'];
    
$marca=$_POST['marca'];
    
$total_info="Si";
    
$id_prod=$_POST['id_prod'];
  
$consulta=mysql_query("UPDATE producto SET Producto='".$producto."',Identificacion_pro='".$n_pv."',Referencia='".$ref."',Presentacion='".$presentacion."',N_existencia='".$exis."',N_existencia2='".$exis."',V_unitario='".$vu."',Estado='".$estado."',Fecha_ingreso='".$ingre."',fechabase='".$ingre2."',Fecha_u_modificacion='".$ingre."',N_factura='".$n_fac."',Id_marca='".$marca."',Total_informacion='".$total_info."' WHERE Id_producto='".$id_prod."'")or die(mysql_error()); 

$consulta_orden=mysql_query("SELECT DISTINCT (MAX(N_orden_entrada)) AS N FROM producto ORDER BY N_orden_entrada ASC")or die(mysql_error());

$fila_orden=mysql_fetch_object($consulta_orden);
$base=$fila_orden->N;
$orden_entrada=$base+1;

$update=mysql_query("UPDATE producto SET N_orden_entrada='".$orden_entrada."' WHERE N_factura='".$n_fac."'")or die(mysql_error());

header("location:orden_E_A.php?f=$n_fac&f_i=$ingre");
exit;      
}

if(isset(
$_POST['ok_pro_siguiente']))
  {
    
$producto=$_POST['producto'];
    
$n_pv=$_POST['n_pv'];
    
$ref=$_POST['ref'];
    
$presentacion=$_POST['presentacion'];
    
$exis=$_POST['exis'];
    
$vu=$_POST['vu'];
    
$ingre=$_POST['ingre'];
    
$ingre2=substr($ingre,0,10);
    
$estado="Existente";
    
$n_fac=$_POST['n_fac'];
    
$marca=$_POST['marca'];
    
$total_info="Si";
    
$id_prod=$_POST['id_prod'];
  
$consulta=mysql_query("UPDATE producto SET Producto='".$producto."',Identificacion_pro='".$n_pv."',Referencia='".$ref."',Presentacion='".$presentacion."',N_existencia='".$exis."',N_existencia2='".$exis."',V_unitario='".$vu."',Estado='".$estado."',Fecha_ingreso='".$ingre."',fechabase='".$ingre2."',Fecha_u_modificacion='".$ingre."',N_factura='".$n_fac."',Id_marca='".$marca."',Total_informacion='".$total_info."' WHERE Id_producto='".$id_prod."'")or die(mysql_error()); 

header("location:productos_N.php?f=$n_fac&f_i=$ingre&p=$n_pv&n_p=$np");    
exit;  
}

?>
__________________
Luis Alfonso Cruz Valbuena
[email protected]