A. php introduces B. php and cannot obtain the aclass attribute under B.-php Tutorial

Source: Internet
Author: User
For help, A. php introduces B. php and cannot obtain the attribute of aclass under B. This post was last edited by zhanfu86 from 2015-02-0512: 56: 27 on page A & lt ;? Phpinclude (wx. php); $ wx & nbsp; new & nbsp; wxClass (); $ cache & nbsp; $ wx for help,. php introduces B. php, unable to obtain the aclass attribute under B

This post was last edited by zhanfu86 at 12:56:27 on

Page


include("wx.php");
$wx = new wxClass();
$cache= $wx->cache;
?>


Page B


Define ("x"," 1111 ");
Define ("Y", "2222 ");

Class wxClass
{
Var $ x = X;
Var $ y = Y;

Public function _ construct ($ x = NULL, $ y = NULL)
{
If ($ x & $ y ){
$ This-> x = $ x;
$ This-> y = $ y;
}
// Connect to the memcache of Sina sae and activate it
$ Mem = memcache_init ();
$ This-> cache = memcache_get ($ mem, "cache"); // Get Token
If (empty ($ this-> cache ))
{
$ This-> cache = "mmmm ";
Memcache_set ($ mem, "cache", $ this-> cache, 7200); // The Expiration Time is seconds.
}
}
}
?>


Memcache is from Sina SAEs. you can view the cache value of memcache directly on Sina platform, but it cannot be obtained through page. The syntax is correct. Depressing
Please advise. Php I just learned yesterday.
------ Solution ----------------------
Class wxClass
{
Var $ x = X;
Var $ y = Y;

Add one sentence: public $ cache = 1;
What is the result of page?

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.