hey people .
i am trying to set a cookie but when ever i try to set it, it says :
Cannot modify header information - headers already sent by (output started at C:\xampp\htdocs\signup\conf.co.signup.php on line 13
please help me with this.
this is my code:
<?php
error_reporting(-1);
if(isset($_COOKIE['logedin']))
{
?>
<script type="text/javascript">window.location ="../home.php";</script>
<?php
}
else
{
$id = $_GET['id'];
$time = date()+60*60*24*30;
$q = setcookie("logedin", $id, $time);
if($q){
?>
<script type="text/javascript">
window.location = "../home.php";
</script>
<?php
}
else
{
?>
<div id="dialog" title="Error"><p>cant create the cookie</p></div>
<?php
}
//the last closing }
}
thanks