Ver Mensaje Individual
  #1 (permalink)  
Antiguo 08/06/2008, 22:25
pmnacho
 
Fecha de Ingreso: junio-2008
Mensajes: 4
Antigüedad: 15 años, 10 meses
Puntos: 0
Redireccionamiento - funcion header

Hola, este es mi 1er mensaje.
Estoy haciendo un pequeño programa de control de precios de compras en supermercados, mas que nada para interiorizarme en el uso de php y mysql.
estoy usando dreamweaver 8 para lo que es el diseño de pantallas y programacion php.
tengo una pantalla donde ingreso las compras, q el usuario va ingresando cada producto y su cantidad, y luego este formulario se debe llamar a si mismo para ingresar un nuevo producto mientras clickee en ingresar, si clickea en cerrar compra deberia ir a otro archivo php donde hace todos los calculos y el ingreso a la base de datos de los mismos.
el problema q tengo es q no me funciona la funcion header para redireccionarlo a cada uno de los archivos donde hace cada accion (los mismos todavia no los tengo programados).
el error q me da es el siguiente

Warning: Cannot modify header information - headers already sent by (output started at C:\Archivos de programa\AppServ\www\Compras\ingresar_compra.php:1 3) in C:\Archivos de programa\AppServ\www\Compras\ingresar_compra.php on line 88

uso algunos echo para ir debugueando el codigo.
alguien me puede tirar una soga y decirme como solucionar este inconveniente...
gracias.
aca les envio el codigo fuente
un saludo.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Formulario de Ingreso de Compra</title>
</head>

<body>
<form id="form1" name="form1" method="post" action="ingresar_compra.php">
<table width="357" border="1">
<tr>
<td>Fecha (Dias / Mes / A&ntilde;o) </td>
<td><label>
<input name="dia" type="text" id="dia" size="2" maxlength="2" />
/


<input name="mes" type="text" id="mes" size="2" maxlength="2" />
/
</label>
<label>
<input name="ano" type="text" id="ano" size="4" maxlength="4" />
</label></td>
</tr>
<tr>
<td width="184">Super</td>
<td width="157"><label>
<select name="select">
<option>LA ANONIMA</option>
<option>SUPERVEA</option>
<option>CARREFOUR</option>
</select>
</label></td>
</tr>
</table>
<table width="357" border="1">
<tr>
<td width="149"><p>Producto</p></td>
<td width="192"><label>
<input name="producto_id" type="text" id="producto_id" />
</label></td>
</tr>
<tr>
<td>Cantidad</td>
<td><label>
<input name="cantidad" type="text" id="cantidad" />
</label></td>
</tr>
</table>
<p>
<label>
<input name="ingresar" type="submit" id="ingresar" value="Ingresar" />
</label>
<label>
<input name="cerrar" type="submit" id="cerrar" value="Cerrar Compra" />
</label>
</p>
</form>
<p>&nbsp;</p>
<p>&nbsp;</p>
<?
if (!$producto_id || !$cantidad)
{
echo "No has introducido todos los detalles requeridos.<br>"."Por favor vuelve e inténtalo de nuevo.";
exit;
}

$fecha = array($_POST['mes'], $_POST['dia'], $_POST['ano']);
if(@checkdate($_POST['mes'], $_POST['dia'], $_POST['ano']))
{
//echo "fecha OK<br>";
;
}
else
{
//echo "fecha erronea<br>";
;
}
$fecha_junta = implode("/", $fecha);


$ingresar = $_POST['ingresar'];
$cerrar_compra = $_POST['cerrar'];
if($ingresar != "")
{
//echo "click en enviar.<br>";
header('Location: .//prueba.php');
}
else if($cerrar_compra != "")
{
//echo "click en cerrar.<br>";
header("locacion: .//prueba.php");
}


?>

</body>
</html>