siu02rk wrote:
[color=blue]
> Gary L. Burnore <gburnore@databasix.com> wrote in message news:<ch86uc$9od$1@blackhelicopter.databasix.com>. ..
>[color=green]
>>On Thu, 02 Sep 2004 22:23:29 GMT, "kingofkolt"
>><jessepNOSPAM@comcast.net> wrote:
>>
>>[color=darkred]
>>>"siu02rk" <siu02rk@hotmail.com> wrote in message
>>>news:823c05f1.0409021222.59c1dfdb@posting.googl e.com...
>>>
>>>>Hi all,
>>>>
>>>>I am trying to get an understanding of classes within PHP. What is
>>>>wrong with this code:
>>>>
>>>>
>>>><html>
>>>><title> This is my test for creating a class </test>
>>>><body>
>>>><?php
>>>> class Test
>>>> {
>>>>$Message = "Default Message";
>>>>
>>>> Test($Message)
>>>>{
>>>> $this->$Message=$Message;
>>>>}
>>>>
>>>>Display_Message()
>>>>{
>>>> echo "$Message";
>>>>}
>>>> }
>>>>
>>>> $TestObject = new Test("Hello World!!");
>>>> $Testobject->Display_Message();
>>>
>>>change to:
>>>$TestObject->Display_Message(); // (capitalization error)
>>>[/color]
>>
>> And, less importantly, change </test> to </title>
>>--
>>gburnore@databasix dot com
>>---------------------------------------------------------------------------
>> How you look depends on where you go.
>>---------------------------------------------------------------------------
>>Gary L. Burnore | ÝÛ³ºÝ³Þ³ºÝ³³Ýۺݳ޳ºÝ³Ý³Þ³ºÝ³ÝÝÛ³
>> | ÝÛ³ºÝ³Þ³ºÝ³³Ýۺݳ޳ºÝ³Ý³Þ³ºÝ³ÝÝÛ³
>>DataBasix | ÝÛ³ºÝ³Þ³ºÝ³³Ýۺݳ޳ºÝ³Ý³Þ³ºÝ³ÝÝÛ³
>> | ÝÛ³ 3 4 1 4 2 ݳ޳ 6 9 0 6 9 ÝÛ³
>>Black Helicopter Repair Svcs Division | Official Proof of Purchase
>>================================================ ===========================
>> Want one? GET one!
http://signup.databasix.com
>>================================================ ===========================[/color]
>
>
>
>
> Hi All,
>
> My code is now :
>
> <html>
> <title> This is my test for creating a class </test>
> <body>
> <?php
> class Test
> {
> var $Message = "Default Message";
>
> function Test($Message)
> {
> $this->Message=$Message;
> }
>
> function Display_Message()
> {
> this->echo Message;
> }
> }
>
> $TestObject = new Test("Hello World!!");
> $Testobject->Display_Message();
> ?>
> </body>
> </html>
>
>
>
> But it still does not work!! Can anyone help? Thanks again for your help.[/color]
In function Display_Message(),
this->echo Message;
should be
echo this->Message;
--
Jasper Bryant-Greene
Cabbage Promotions