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 FTP connect doesn't work with correct login
Hi!

i am working on this test code:
Quote<?php

$ftp_ser

Not "Just Another" MMORPG - text based.
Hello,

I've been learning MySQL and PHP for the last 2-3 years.
Though, I've had long paus

FTP Programs
Here is a list of commonly suggested FTP Programs to use:

FileZilla
SmartFTP
CuteFTP

dropdown menu
Hello everbody,

I am php newbie.
I need to develop a program that once click the drop do

switch form actions? not working
i want on submit to go to different pages according to the CatID

Code: <?php $CatID=$_

strtotime issue
Hey all,

I'm playing around with some code, and basically the idea is:

Person changes

need to add "sizes" to shopping cart
Hey guys, I am trying to figure out a way to add a "size" selector on to this bit of code.

Apple's revamped lineup arrives

I'm personally curious about the magic mouse.. a multi-touch concept sounds like it could be nea

php require help needed
Ok i tried to use the search funtion but the word require is everywhere.

i'm really new to cr

Php script to read msword file
hi,

I need to read a msword file and i want to print the contents in that word file.

i

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