|
楼主 |
发表于 2006-1-20 21:00:27
|
显示全部楼层
class inputcontent
{
var $txt;
var $txtname ;
var $wordtxt ;
function inputcontent($txt,$txtname,$wordtxt)
{
$this->txt=$txt ;
$this->txtname=$txtname;
$this->wordtxt=$wordtxt;
echo "<td>".$txt.":</td><td><input type=text name=".$txtname."maxlength=13 size=32 class=butn value=".$wordtxt."></br></td>";
}
}
以上为一个例孖,例如它出现在atc.php中
在其它文件中
require("atc.php");
然后
echo "<tr>" ;
$input1=new inputcontent("文號","number","") ;
$input2=new inputcontent("日期","pub_date",DATE("Y-m-d")) ;
echo "</tr>" ;
echo "<tr>" ;
$input3=new inputcontent("單位","department","") ;
$input4=new inputcontent("受文者","receiver","") ;
echo "</tr>" ;
是不是很方便呢?当然这只是一个简单的例子..
繁体叫物件导向 |
|