Hi Guys,
this is my class of style below. I used this file as html_class.inc.
No my problem is how can I call the function Style() and function Body() in my index.php to perform their function??
Please here is my code.
<?php
class Style
{
var $text;
var $alink;
var $vlink;
var $link;
var $bgcol;
var $face;
var $size;
var $align;
var $valign;
function Style($text="#CCCCFF", $alink="#AA00AA", $vlink="#AA00AA", $link="#3333FF", $bgcol="#999999", $face="Book Antiqua", $size=3, $align="CENTER", $valign="TOP")
{
$this->text=$text;
$this->alink=$alink;
$this->vlink=$vlink;
$this->link=$link;
$this->bgcol=$bgcol;
$this->face=$face;
$this->size=$size;
$this->align=$align;
$this->valign=$valign;
}
function Body() {
echo "<body bgcolor=\"{$this->bgcol}\" text=\"{$this->text}\" link=\"{$this->link}\" vlink=\"{$this->vlink}\" alink=\"{$this->alink}\">\n <font face=\"{$this->face}\" size=\"{$this->size}\">\n";
}
function TextOut($message=" ")
{
echo "<font face=\"{$this->face}\" size=\"{$this->size}\" color=\"{$this->text}\">{$message}</font>\n";
}
}
?>
calling functions in php
Moderator: General Moderators
Code: Select all
$oStyle = new Style;
$oStyle->Style();
$oStyle->body();