Hi ,

I have two method in a class, I would like to aceess method1's variable in method2.

How is this possible in php 5.

Method 1;

static public function sendEmails30daymember($sponsor)
	{
		 $sendemail30='30';

	self::sendEmails($sponsor);
	return $temp;
}

Method 2:

private function sendEmails($sponsor)
{
	//pick email content
	echo $sendemail30;

	if (isset($sponsor)) {

		//if sponsor is one of the house bbs accounts, the person is a cold lead
		if (dbhelper::isColdReferrer($sponsor))
		//if (dbhelper::getUserName($sponsor) == 'bbs')
		{
			echo "3";
			$emhtml = contentJoin::emailColdLeadHtml();
			$emtext = contentJoin::emailColdLeadText();
		} else {

			/*
			echo "2";
			$emhtml = contentJoin::emailWarmLeadHtml();
			$emtext = contentJoin::emailWarmLeadText();

			*/
			switch ($sendemail30) {

			case "30":
				$emhtml = contentJoin::emailWarmLeadHtml30();
				$emtext = contentJoin::emailWarmLeadText30();
				break;
			default:
					$emhtml = contentJoin::emailWarmLeadHtml();
					$emtext = contentJoin::emailWarmLeadText();
			}



		}
	} else {

		echo "1";
		$emhtml = contentJoin::emailWarmLeadHtml();
		$emtext = contentJoin::emailWarmLeadText();
	}				


	}
}

Thanks in advance

Sharma

    You could use the [man]global[/man] keyword, or make it a private property.

      Write a Reply...