PHP Code:
class chat {
function a_header($title = 'chat-zone.mobi',$time_update = '0'){
header("Cache-Control: no-store, no-cache");header("Content-type:text/html; charset=utf-8");
echo '
.rootlink.'css/css.css"/>
';if (!empty($time_update)){echo '.$time_update.'" />';}echo '';
}
function a_footer($url = '',$name = 'Logout')
{
if (empty($url)) {$url= rootlink.'?action=logout';}
echo '.$url.'&'.SID.'">'.$name.'
';
}
function write($text)
{
echo $text;
}
function form($link = 'index.php',$method = 'post')
{
echo '.$link.'" method="'.$method.'">';
}
function input($text,$name,$size='',$maxlength,$value = '')
{
if(!empty($text)){echo $text.'
';}
echo '.$name.'" ';
if($size > 0 && !empty($size)){echo 'size="'.$size.'" ';}
if($maxlength > 0){echo 'maxlength="'.$maxlength.'" ';}
echo 'value="'.$value.'" class="itext"/>
';
}
function hidden($name,$value)
{
echo '.$name.'" value="'.$value.'"/>';
}
function checkbox($name,$value,$nme = '')
{
echo '.$name.'" value="'.$value.'"/>'.$nme.'
';
}
function button($name,$value,$o = '',$c = '')
{
if(!empty($c)){echo '.$name.'" value="'.$value.'" checked="checked"/>'.$o.'
';}
else{echo '.$name.'" value="'.$value.'"/>'.$o.'
';}
}
function end_form($value)
{
echo '.$value.'" class="ibutton"/>';
}
function select($name, $value)
{
echo '.$name.'" value="'.$value.'">';
}
function addselect($value, $label)
{
echo '.$value.'">'.$label.'';
}
function select_end()
{
echo '
';
}
}?>
usage
chat::a_header('chat-zone.mobi');
chat::write('hi');
chat::a_footer();
or
$chatcls = new chat;
$chatcls->input('login',login,'15','15',$_SESSION['nicks']);
No comments:
Post a Comment