Code: Select all
<?php
$u=$_GET['u'];
if ($u != NULL)
{
$name=$_POST['name'];
$session=$_GET['session'];
setcookie("name", $name, time()+3600);
setcookie("session", $session, time()+3600);
}Name is the persons posted name, and session is a random number of so-many digits.
I get this when I use it:
Line 7 and 8 are the two cookie lines.Warning: Cannot modify header information - headers already sent by (output started at C:\xampp\phpMyAdmin\site\index.php:39) in C:\xampp\phpMyAdmin\79new\includes\chat79.inc on line 7
Warning: Cannot modify header information - headers already sent by (output started at C:\xampp\phpMyAdmin\site\index.php:39) in C:\xampp\phpMyAdmin\79new\includes\chat79.inc on line 8
Why won't this work?