A cookie about the problem, I hope the great God help me A, thank you, say where the wrong

Source: Internet
Author: User
Tags setcookie
A cookie question, I hope the great God help me, thank you, say what is wrong?
PHP Code

Hello, you are the first time to login!
Warning:cannot Modify header Information-headers already sent by (output started at D:\LAMP\AppServ\www\cookie\lastVisi T.php:4) in D:\LAMP\AppServ\www\cookie\lastVisit.php on line 6

So change the code ... In addition, if it is a UTF-8 encoded document, be careful not to have B

PHP Code
$first = False;if (Empty ($_cookie[' lastvisit ')) {    $first = TRUE;    Setcookie ("Lastvisit", Date (' y-m-d h:i:s '), time () + 30 * 24 * 3600);} else {    $first = FALSE;    Setcookie ("Lastvisit", Date (' y-m-d h:i:s '), time () + 30 * 24 * 3600);} if ($first) {    echo "Hello, you are the first to log in!" ";} else {    echo "Your last access Time is". $_cookie[' lastvisit ');}
  • Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.