Echoing a Variable from a Object


Posted on 16th Feb 2014 07:03 pm by admin

How do I get a variable from the new User Class to echo out in this clasS?

class MyApp
{

function __construct()
{
global $dbHost;
global $dbUser;
global $dbPass;
global $dbName;

$this->DB = new Database;
$this->DB->connect($dbHost, $dbUser, $dbPass, $dbName);

$User = new User;

echo $User->login;
echo $this->User->login;

}


}

No comments posted yet

Your Answer:

Login to answer
271 Like 8 Dislike
Previous forums Next forums
Other forums

PHP mail() returns true but doesn't work
First off I apologize if this is a newbie question, and I generally don't like asking questions that

Security Exception on pages using AJAX
I am getting the exception: attempted to perform an operation not allowed by the security policy on

Navigation include for all site directories
Hi,

I need a navigation include that can deal with directories at different levels on a site.

Undefined offset
The following script checks to see if the user answer matches the correct answer.

Form Fiel

that old Malformed Headers problem again!!!!! HELP!!!!!!
I've read the http://www.phpfreaks.com/forums/index.php/topic,37442.0.html

I don't think my c

Wordpress IE issue
So I am trying to add the background shadow to my wordpress page. It works fine in Firefox but does

frames get header location..
i have two frames, one top, one bottom. how do i do a form on the bottom frame that gives me the ur

Multi language - seo links
Im trying to figure out the best method to have a multi language website that will function with seo

SAP Treasury - Commodities
We are running SAP ECC 6.0 with Treasury Activated.
EA-FIN is also activated (SFW5).

Echoing ASCII code
I have a php page that splits a string into chars and then echoes the ASCII code for each char. I'm

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash