PDA

Click to See Complete Forum and Search --> : [RESOLVED] Problem with class & members


eL_NiNo
Oct 2nd, 2002, 11:11 AM
I have a problem accessing my members of my class :


<?php

class CUser
{
var $strName;
var $lID;

function CUser()
{
$strName= '';
$lID = 0;
}
function Load( $strLogon )
{
$strName = 'test';
$lID = 999;
echo $strName; // Output 'test'

}
}

In PHP page :

$cxUser= new CUser;
$cxUser->Load( 'mylogon' );

echo $cxUser->strName; // output ''

$cxuser = null
?>


any idea ?

eL_NiNo
Oct 2nd, 2002, 11:34 AM
*** Resolved ***
Forgot to use $this->param = value;

Love those nasty little bug :P