simple class & constructor

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi everyone,

I've been really good at googling to find my answers, but this time my
method isn't working for me.

I have created a very simple class and a constructor hoping to get a
much better understanding of how to work with them. The code works, but
because it's very simple, I'm not sure that the way  I'm trying to
access it is possible. 

All I'm trying to do is "access the class from outside the function".
(is that how to describe it?)

For instance I have this simple code:

class simpleConstructer {
  
function __construct() {
    echo "running the constructor";
}
}

$test=new simpleConstructer();


Basically I want to learn how I can (if it's possible with this simple
code) is display the output on a different page.

I tried putting the line: $test=new simpleConstructer(); on the index
page and including the page the class is on, but it causes the index
page to go blank.

The thought of a session crossed my mind, but I'm pretty confident at my
level to know I don't need a session.

Could someone point me in the right direction or give me some pointers,
advice?

-- 
Blessings
David M.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux