How information is passed between pages (cookie,session)

Source: Internet
Author: User
Tags form post setcookie
1. Use the redirect method of the header () function to implement Web page jumps. Exe:header ("location:http://www.example.com/"); 2.URL GET request with parameter Exe:http://www.examble.com?id=1 3. Hide the form to store data, transfer the data through the form post,get and upload the information to the PHP page: * Web settings hidden form to transfer information, Input Settings Display:none. 4. Create a cookie and place the information on the client computer to create: <?php setcookie (' userName ', ' Docter ', Time () +60*60*24*7, '/test ', '. examble.com ', 1)? &  Gt  The code indicates that a cookie,name=username,value=docter has been created, stored for a week, valid in the test directory, valid under the examble.com domain name, and 1 means that a secure connection can be invoked. * Only one cookie call can be set at a time: <?php echo $_cookie[' name '; | |   Echo $_cookie;  ?> Delete: <?php setcookie ("Uesename"); ||     Setcookie ("UserName", "", Time ()-1); ?> 5. Create session to put information on the server

How information is passed between pages (cookie,session)

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.