Common workarounds for Cookie invalidation in PHP development

Source: Internet
Author: User
Common workarounds for Cookie invalidation in PHP development
Common workarounds for Cookie invalidation in PHP development
Cookies exist on the client side, not related to the server, note the case of your program, Linux is case-sensitive, and the configuration of the PHP tutorial, such as whether register_globals = OFF configuration on both sides of the same and so on.
The meaning of the @ and # symbols of PHP

function foo ($n) {    $result = 1/$n;    return $result;} echo @foo (0); A 0 error is generated in the function, but the error is not displayed when the @ is added. echo "End"; Output end

# comment Symbols

As with//, # is a single-line comment (Multi-line Comment */* */).

[email protected], even if the cookie is written in error, will not output, [email protected] Setcookie, the program output the following error message:

Warning:cannot Modify header Information-headers already sent by (output started at

After a search on the internet, found that the original in the Setcookie Setup can not have any output content, and then go to check the code, also did not find out in Setcookie before the output of things, in a bit, found the problem, the specific content as follows:
Today in the WordPress Chinese forum stroll around. The jar is not very popular, but there are a lot of good masters. Will write plug-ins and templates of the master and even edit files will not be mixed with beginners, the forum is so, haha.
See the same error in several posts, such as the one mentioned in this post: "Warning:cannot Modify header Information-headers already sent by (output started at c:progr Am fileseasyphp1-8wwwwp-config.php:1) in C:Program fileseasyphp1-8wwwwp-login.php on line 9 "
This is a very typical problem. WordPress program execution will first call the Wp-config.php class of configuration files, will also call wp-db.php to establish a database tutorial connection for later use. These files just do some setup and do not output HTML code. After the setup is finished, the program itself starts executing, and some programs use the header command to set an HTTP header. Because the HTTP header must be set before the HTML code output, otherwise the HTML code has already started to send to the client, HTTP has already been sent, cannot chase back to reset. WordPress Codex The question: How does I solve the Headers already sent warning? The article points out: To ensure that individual files-especially wp-config.php files that are often edited-are

  • 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.