PDA

Click to See Complete Forum and Search --> : [RESOLVED] Problem about header("location:..")


Lightzero
May 14th, 2006, 07:46 PM
Hi friends,
I get warning message like :
"Warning: Cannot modify header information - headers already sent by (output started at G:\AppServ\www\Indikator\in_indikator.php:97) in G:\AppServ\www\Indikator\in_indikator.php on line 113"

In my source i have :

<? include "config.php";
if(!isset($_SESSION["Username"]))
{
header("location:Login.php");
}
?>
.
. //This HTML Code
.
<?
if(!isset($Register))
{
header("location:in_register.php");
}
$query=mysql_query("Select MRN,Code,Name,DocId,Pav,Release From Register where Kode='" . $Register . "'",$con);


if (mysql_num_rows($query)>0)
{
$qry2=mysql_query("Select MRN,Code From Indikator where Kode='".$Register."'",$con);
if(mysql_num_rows($qry2)>0)
{
header("location:in_register.php?pesan='Register already existed'"); // This is line 113
}
$hasil=mysql_fetch_row($query);
}
?>

Is there any solution ???
Thank You for your help .... :D :D

mar_zim
May 14th, 2006, 08:56 PM
See here. http://vbforums.com/showpost.php?p=2467208&postcount=12

Jmacp
May 15th, 2006, 04:48 AM
if your running it on your own pc go to your php.ini and set output_buffering = Off.

Lightzero
May 17th, 2006, 10:34 PM
It looks like i place my code after html tag.... It must be before html tag
Ok Thank you for your help.....