PHPCookbook Reading Notes-Chapter 1 web Basics

Source: Internet
Author: User
Tags set cookie
This chapter describes some basic web-related knowledge, such as cookies, get requests, post requests, and read/write environment variables. Setcookie (): Set cookie value $ _ COOKIE [name]: Get cookie value browser redirection: header (Location: www.example.comconfirm.html); get_browser (): Get

This chapter describes some basic web-related knowledge, such as cookies, get requests, post requests, and read/write environment variables. Setcookie (): Set cookie value $ _ COOKIE ['name']: Get cookie value browser redirection: header ('location: http://www.example.com/confirm.html'); get_browser (): Get

This chapter mainly introduces some web-relatedBasicKnowledge, such as cookies, get requests, post requests, and read/write environment variables.

Setcookie (): Set the cookie value

$ _ COOKIE ['name']: Get cookie value

Browser redirection: header ('location: http://www.example.com/confirm.html ');

Get_browser (): Get browser Parameters
Http_build_query (): converts an array to a query string.

$ Vars = array ('name' => 'oscar the Grouch ', 'color' => 'green', 'favorite _ punctuation' => '#'); $ query_string = http_build_query ($ vars); $ url = '/muppet/select. php? '. $ Query_string; the result is:/muppet/select. php? Name = Oscar + the + Grouch & color = green & favorite_punctuation = % 23

Php: // input: the source to obtain the original post data, which should be used less

$ _ SERVER ['php _ AUTH_USER '] and $ _ SERVER ['php _ AUTH_PW']: HTTP verification, almost unavailable

Flush (): sends all output of the program so far to the user's browser.

Ob_start (): Enable the output buffer. All outputs will not be sent immediately.

Ob_end_flush (): Close the output buffer and send all the output to the user's browser.

Getenv (): Get the environment variable

Putenv (): Set Environment Variables

Http://www.cnblogs.com/Excellent

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.