HI TSDN Pals,
I am trying to create an object to modify its colour, size, message attributes on the fly using OOP concept...
Everything works fine with this code but the problem is the font size is not changing. I have highlighted the problem area in the below snippet.
// Start of the Snippet
-------------------------------
[code=php]
class theme{
var $fontColour;
var $fontSize;
var $amessage;
function __construct($fo ntColour,$fontS ize){ // attribute intialization
$this->fontColour=$fo ntColour;
$this->fontSize=$font Size;
}
function accessMessageFe tch() { // amessage attrirbute fetching from file
$fd=fopen("incl udes/amessage.inc", "r+") or die ("Can't open the file amessage.inc");
$fstring =fread($fd, filesize("inclu des/amessage.inc")) ;
$this->amessage=$fstr ing;
fclose($fd);
}
function accessDisp(){ // display function
/*************** *************** *************** ****
* Problem Area:
*************** *************** *************** ****/
echo "<span><fon t color=/'".$this->fontColour."/' size=/'".$this->fontSize."/'>".$this->amessage."</font></span>"; // Problem area
}
} // end of class
$themeSetting=n ew theme('#3671AD' ,+2);
$themeSetting->accessMessageF etch();
$themeSetting->accessDisp() ;[/code]
[Please use CODE tags when posting source code. Thanks! --pbmods]
Please advice...
I am trying to create an object to modify its colour, size, message attributes on the fly using OOP concept...
Everything works fine with this code but the problem is the font size is not changing. I have highlighted the problem area in the below snippet.
// Start of the Snippet
-------------------------------
[code=php]
class theme{
var $fontColour;
var $fontSize;
var $amessage;
function __construct($fo ntColour,$fontS ize){ // attribute intialization
$this->fontColour=$fo ntColour;
$this->fontSize=$font Size;
}
function accessMessageFe tch() { // amessage attrirbute fetching from file
$fd=fopen("incl udes/amessage.inc", "r+") or die ("Can't open the file amessage.inc");
$fstring =fread($fd, filesize("inclu des/amessage.inc")) ;
$this->amessage=$fstr ing;
fclose($fd);
}
function accessDisp(){ // display function
/*************** *************** *************** ****
* Problem Area:
*************** *************** *************** ****/
echo "<span><fon t color=/'".$this->fontColour."/' size=/'".$this->fontSize."/'>".$this->amessage."</font></span>"; // Problem area
}
} // end of class
$themeSetting=n ew theme('#3671AD' ,+2);
$themeSetting->accessMessageF etch();
$themeSetting->accessDisp() ;[/code]
[Please use CODE tags when posting source code. Thanks! --pbmods]
Please advice...
Comment