Php-php Tutorial

Source: Internet
Author: User
Php high-score solving function: defines a global $ aaa variable on the phpA page. you need to use the value of the variable $ aaa on the phpB page. how can this problem be solved. ------ Solution -------------------- BincludeA... is that acceptable? Or can I renew the value? Or a cookie? Session? ------ Solution ------------------ php high score solution
Function: define A global $ aaa variable on the php A page. you need to use the value of the variable $ aaa on the php B page. how can this problem be solved.

------ Solution --------------------
B include A... is that acceptable? Or can I renew the value? Or a cookie? Session?
------ Solution --------------------
Let's look at the writing method. for example, there are two.
The page only needs to be require or include.
------ Solution --------------------
There are no other methods except session, cookie, get, and post ..
------ Solution --------------------
Session/cookies
------ Solution --------------------
Discussion

There are no other methods except session, cookie, get, and post ..

------ Solution --------------------
Variable scope,

Any variables other than classes and functions are $ GLOBAL variables!

There are also system super global variables. $ _ GET, $ _ POST, and so on. It has a global scope!
------ Solution --------------------
You must use cookies or sessions to implement this.
------ Solution --------------------
Include or require.
------ Solution --------------------
Session cookie global variables

Give me some points. thank you.

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.