amir103
02-10-2007, 05:00 PM
Here is a part of a page of code, notice the header("location:../index.php") at the bottom.
<script language="javascript" type="text/javascript">
if (window!= top)
<? $kn_frame_present = '1'; ?>
</script>
<? $kn_poss_decide = 'kn_not_possible';
if ($kn_frame_present == '1') {
$kn_poss_decide = 'kn_possible';
}
if (empty($_SESSION['kn_splash'])) {
$kn_poss_decide = 'kn_possible';
}
elseif ($_SESSION['kn_splash'] == '1') {
$kn_poss_decide = 'kn_possible';
}
$$kn_poss_decide = 'kn_approved';
?>
<? if ($kn_possible = 'kn_approved') {
$_SESSION['kn_return_id'] = '?kn_return=kn_content/1_news.php';
header("location:../index.php");
}
?>
In the header(location:'s current position, i'm recieveing this error:
'Cannot modify header information - headers already sent by (output started at'
I've tried placing the header on the very top of the page, and it worked, which means it doesn't work if its under that small javascript. The javascript is essential though, and decides wether to header or not, so how can I make this work? Is there a trick know to fix this sort of problem?
<script language="javascript" type="text/javascript">
if (window!= top)
<? $kn_frame_present = '1'; ?>
</script>
<? $kn_poss_decide = 'kn_not_possible';
if ($kn_frame_present == '1') {
$kn_poss_decide = 'kn_possible';
}
if (empty($_SESSION['kn_splash'])) {
$kn_poss_decide = 'kn_possible';
}
elseif ($_SESSION['kn_splash'] == '1') {
$kn_poss_decide = 'kn_possible';
}
$$kn_poss_decide = 'kn_approved';
?>
<? if ($kn_possible = 'kn_approved') {
$_SESSION['kn_return_id'] = '?kn_return=kn_content/1_news.php';
header("location:../index.php");
}
?>
In the header(location:'s current position, i'm recieveing this error:
'Cannot modify header information - headers already sent by (output started at'
I've tried placing the header on the very top of the page, and it worked, which means it doesn't work if its under that small javascript. The javascript is essential though, and decides wether to header or not, so how can I make this work? Is there a trick know to fix this sort of problem?