PHP Class not working
Posted: Mon Oct 24, 2005 2:55 pm
Jcart | Please use
Jcart | Please use
Code: Select all
andCode: Select all
tags where appropriate when posting code. Read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]
Hi All
I am new to php, php page is not displaying whenever I use Class.
Following is my code, which is not displaying anything, simply displaying the blank page.
I am using PHP Version 5.0.4.
Can you please help to solve this problem.
Thanks in Advance
Regards
RahmaCode: Select all
<?php
class TextBoxSimple {
var $body_text = "my text"
function display() {
print("<TABLE BORDER=1><TR><TD>$this->body_text");
print("</TD></TR></TABLE>");
}
}
$box = new TextBoxSimple();
print "......hello..........";
$box->body_text = "custom text";
$box->display();
?>Jcart | Please use
Code: Select all
andCode: Select all
tags where appropriate when posting code. Read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]