Perdón, en realidad están mal ubicados el
ob_start()
y el
ob_end_flush()
.
En el archivo php donde ejecutas el JS, al comienzo de todo, incluso antes de tu
session_start()
, agregá el
ob_start()
y al final de todo en
ob_end_flush()
.
Ejemplo:
Código PHP:
<?php
ob_start();
$identifica=$_GET['iden'];
$iden=$identifica;
?>
<script language="JavaScript">
if (screen.width<=600)
<?php header("Location: pruebadivs.php?iden=".$iden); ?>
else
<?php header("Location: indeednuevo.php?iden=".$iden); ?>
</script>
<?php
// Supongamos que acá termina tu archivo
ob_end_flush();
?>
Con eso debería funcionar.
Saludos :)