How to obtain the session in php

Source: Internet
Author: User
In php, how does one get the session in the shopping cart? what does the session mean? How does one get the session value? How does one write the shopping cart program, thank you ------ solution ------------------ first session_start (); then you can directly set the session $ _ SESSION [val] value; then you can get the session in php on other pages.
In the shopping cart, what does the session mean, how to get the session value, and how to write the shopping cart program? who knows? send me one. thank you!

------ Solution --------------------
First session_start ();
Then you can directly set the session.
$ _ SESSION ['Val'] = 'value ';
You can directly use this session on other pages after setting
Go to the internet and look for "PHP and MySQL Web Development". the source code of the shopping cart is made by session.
------ Solution --------------------

Session_start ();
Session_register ("G_loginuser"); // login id, which can be used to authorize a user

Get $ G_loginuser = '$ ';

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.