T_OBJECT_OPERATOR

This is a discussion on T_OBJECT_OPERATOR within the alt.comp.lang.php forums, part of the PHP Programming Forums category; I am getting the following error Parse error: parse error, unexpected T_OBJECT_OPERATOR in C:\m\www\php\class\class_myhtml.php ...


Go Back   Usenet Forums > PHP Programming Forums > alt.comp.lang.php

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 12-12-2005
meshulamgill@gmail.com
 
Posts: n/a
Default T_OBJECT_OPERATOR

I am getting the following error
Parse error: parse error, unexpected T_OBJECT_OPERATOR in
C:\m\www\php\class\class_myhtml.php on line 9
Please help. The code is below

------------------------------------------------------------------------------------------------------------
1. <?php
2. class myhtml{
3. var $starthtml;
4. var $heading;
5. var $body;
6. var $endhtml;
7.
8. function myhtml($heading,$body) {
9. this->starthtml = "<html>";
10. this->heading = '<heading>' .$heading . '</heading>';
this->body = '<body>'.$body .'</body>';
//this->endhtml = '</html>';
}
function display()
{
$str= this->starthtml . this->heading . this->body . this->endhtml ;
echo $str;
}




}


?>
------------------------------------------------------------------------------------------------------------
<pre>
<?php

include "class_myhtml.php";
$page1 = new myhtml('myhead','hello world');
$page1.display;

?>
</pre>
------------------

Reply With Quote
  #2 (permalink)  
Old 12-12-2005
Oli Filth
 
Posts: n/a
Default Re: T_OBJECT_OPERATOR

meshulamgill@gmail.com said the following on 12/12/2005 22:52:
> I am getting the following error
> Parse error: parse error, unexpected T_OBJECT_OPERATOR in
> C:\m\www\php\class\class_myhtml.php on line 9
> Please help. The code is below
>
> ------------------------------------------------------------------------------------------------------------
> 1. <?php
> 2. class myhtml{
> 3. var $starthtml;
> 4. var $heading;
> 5. var $body;
> 6. var $endhtml;
> 7.
> 8. function myhtml($heading,$body) {
> 9. this->starthtml = "<html>";


Missing a $...

--
Oli
Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 12:10 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0