-1

I wanted to do "remember me" option in my login form but i still getting error:

;llfdfdffddffdfd Warning: Cannot modify header information - headers already sent by (output started at /home/chumorekgn/www/maneku/log-in.php:40) in /home/chumorekgn/www/maneku/log-in.php on line 76

Warning: Cannot modify header information - headers already sent by (output started at /home/chumorekgn/www/maneku/log-in.php:40) in /home/chumorekgn/www/maneku/log-in.php on line 77

I dont know what should i do... Here is my code

             if(isset($_GET['r'])){
                echo ";llfdfdffddffdfd";
                setcookie("Maneku_login", base64_encode($l));
                setcookie("Maneku_pass", base64_encode(md5(md5(base64_decode($h)))));
            }
Doknes
  • 9
  • 4

1 Answers1

0

when the request is made to the page the header is sent first and that header contains all the information like cookies, session and other useful information. When request is sent if the server finds the request similar to previous one then it will give response “header already sent”.

So the error in PHP is shown as following:

<?php 

print “text”;

header(‘Location: http://www.example.com/&#8217;);

?>

Check reference for complete solution for issue: http://www.navnishbhardwaj.com/how-to-fix-headers-already-sent-error-in-php/

Navnish Bhardwaj
  • 1,687
  • 25
  • 39