Ver Mensaje Individual
  #10 (permalink)  
Antiguo 19/12/2011, 19:33
Avatar de carlod_39
carlod_39
 
Fecha de Ingreso: noviembre-2011
Ubicación: FAfdddsf
Mensajes: 59
Antigüedad: 12 años, 5 meses
Puntos: 1
Respuesta: php no quiere redireccionar

Cita:
Iniciado por pateketrueke Ver Mensaje
Lee la siguiente Wiki:
[url]http://www.forosdelweb.com/wiki/PHP:%C2%BFPor_qu%C3%A9_me_sale_%22Warning:_Cannot_ modify_header_information_-_headers_already_sent_by_%28output_started_at_1:2% 29_in_3_on_line_4%22%3F[/url]
ya lo leí pero no encuentro ningún error o no lo entiendo
porque tengo
Código HTML:
<input type="hidden" name="usuario" value="<?php echo $_SESSION['nombre'];?>"><!--linea 224 -->
<br><br><br><INPUT TYPE='SUBMIT' value='Ingresar' onclick="return confirmar()"> <INPUT TYPE='reset' value='Limpiar'></FORM> 
Código PHP:
<?php
error_reporting
(-1);
ini_set('display_errors',1);
if (isset(
$_POST["rut"]))
{
mysql_query("insert into maestro_personal (dtrabajados,nombres,apellido_paterno,apellido_materno,rut,afp,sds,direccion,ciudaddp,fn,sexo,ecivil,nacionalidad,telefono,celular,cargo,sueldo,sueldob,fni,fc,dc,ds,fs,dshm,fshm,dsht,fsht,carga,movilizacion,colacion,pcaja,anticipo,gratificacionlegal,bonoi,tramo,estado,feriadolegal,usuario) VALUES ('{$_POST['dtrabajados']}','{$_POST['nombres']}','{$_POST['apellido_paterno']}','{$_POST['apellido_materno']}','{$_POST['rut']}','{$_POST['afps']}','{$_POST['sds']}','{$_POST['direccion']}','{$_POST['ciudaddp']}','{$_POST['fn']}','{$_POST['sexo']}','{$_POST['ecivil']}','{$_POST['nacionalidad']}','{$_POST['telefono']}','{$_POST['celular']}','{$_POST['cargo']}','{$_POST['sueldo']}','{$_POST['sueldob']}','{$_POST['fni']}','{$_POST['fc']}','{$_POST['dc']}','{$_POST['ds']}','{$_POST['fs']}','{$_POST['dshm']}','{$_POST['fshm']}','{$_POST['dsht']}','{$_POST['fsht']}','{$_POST['carga']}','{$_POST['movilizacion']}','{$_POST['colacion']}','{$_POST['pcaja']}','{$_POST['anticipo']}','{$_POST['gratificacionlegal']}','{$_POST['bonoi']}','{$_POST['tramo']}','{$_POST['estado']}','{$_POST['feriadolegal']}','{$_POST['usuario']}')");
header("Location: inicio.php") or die("no quiero redireccionarte");//linea 235
}
y en otro archivo que me funciona tengo


Código PHP:
<?php
if (isset($_POST['nombre']))
{
$nombre=$_POST['nombre'];
$rut=$_POST['rut'];
$actividad_economica=$_POST['actividad_economica'];
$direccion=$_POST['direccion'];
$ciudad=$_POST['ciudad'];
$rlegal=$_POST['rlegal'];
$rutrl=$_POST['rutrl'];
$ciudadeu=$_POST['ciudadeu'];
mysql_query("update datos_empresa Set nombree='$nombre',rute='$rut',actividad_economica='$actividad_economica',direccione='$direccion',ciudade='$ciudad',ciudadeu='$ciudadeu',rlegal='$rlegal',rutrl='$rutrl'");
header("location: datos_empresa.php");
}
y no logro ver la diferencia

Última edición por carlod_39; 19/12/2011 a las 19:40