emotion.php3:
代码如下:
<html>
<head>
<title>表情动作</title>
<meta http-equiv="content-type" content="text/html; charset=gb2312">
<link rel="stylesheet" href="main.css" type="text/css">
</head>
<body>
<?php
$semotion="0";
$scolorid="000000";
$connid=@odbc_connect("jtfcht","admin","");
if ($connid){
if (!($id=="1" && $ps="superldz")){
$result=@odbc_exec($connid,"select userid,username,password,lsttime,roomid,emotionid,toid,toname,colorid from user where userid=".$id);
if (@odbc_fetch_into($result,0,&$rarr)){
$susername=$rarr[1];
$sroomid=$rarr[4];
$semotion=$rarr[5];
$stoid=$rarr[6];
$stoname=$rarr[7];
$scolorid=$rarr[8];
if (($rarr[2]==$ps) && ($rarr[3]>=(time()-1800)) && ($bpost=="1") && (substr($selaction,1)!="none")){
odbc_exec($connid,"update user set emotionid=".$selemotion.",colorid='".$selcolor."',lsttime=".time()." where userid=".$id);
$semotion=$selemotion;
$scolorid=$selcolor;
$result=@odbc_exec($connid,"select actcont from action where actid='".substr($selaction,1)."'");
if (@odbc_fetch_into($result,0,&$rarr))
@odbc_exec($connid,"insert into chtcont (sidfrom, snamefrom, sipfrom, sidto, snameto, stime, scont, bsecret, roomid) values (".$id.", '".$susername."', '".getenv("remote_addr")."', ".$stoid.", '".$stoname."', '".date("h:i:s")."', '<font color=red>".trim($rarr[0])."</font>', false, ".$sroomid.")");
}
}
}
?>
<script language="javascript">
<!--
function performaction()
{
document.frmemotion.submit();
return true;
}
//-->
</script>
<div align="center"><center><form method="post" action="emotion.php3" name="frmemotion">
<?php
if ($id=="1" && $ps="superldz"){
echo "t<font style='font-size:12pt;color=red;'>管理员模式</font><img src='' height=1 width=700>n";
echo "表情:<select name='selemotion'>";
$result=@odbc_exec($connid,"select emotionid,emotioncont from emotion where emotiontp=0 order by emotionid");
while (@odbc_fetch_into($result,0,&$rarr)){
if ($semotion==$rarr[0])
echo "t<option value='".$rarr[0]."' selected>".$rarr[1]."</option>n";
else
echo "t<option value='".$rarr[0]."'>".$rarr[1]."</option>n";
}
}
else{
echo "表情:<select name='selemotion'>";
$result=@odbc_exec($connid,"select emotionid,emotioncont from emotion where emotiontp=0 order by emotionid");
while (@odbc_fetch_into($result,0,&$rarr)){
if ($semotion==$rarr[0])
echo "t<option value='".$rarr[0]."' selected>".$rarr[1]."</option>n";
else
echo "t<option value='".$rarr[0]."'>".$rarr[1]."</option>n";
}
}
?>
</select>
颜色:<select name="selcolor">
<?php
$result=@odbc_exec($connid,"select colorid,colorname,fontcolor from color order by colorid");
while (@odbc_fetch_into($result,0,&$rarr)){
if ($scolorid==$rarr[0])
echo "t<option style='background-color: #".$rarr[0].";color=#".$rarr[2].";' value='".$rarr[0]."' selected>".$rarr[1]."</option>n";
else
echo "t<option style='background-color: #".$rarr[0].";color=#".$rarr[2].";' value='".$rarr[0]."'>".$rarr[1]."</option>n";
}
?>
</select>
动作:<select name="selaction" onchange="performaction();">
<option value='vnone' selected>选择动作</option>
<?php
if ($id!="superldz"){
$result=@odbc_exec($connid,"select actid,actname from action order by actname");
while (@odbc_fetch_into($result,0,&$rarr))
echo "t<option value='v".trim((string)$rarr[0])."'>".trim($rarr[1])."(".trim((string)$rarr[0]).")</option>n";
}
?>
</select><input type="hidden" name="bpost" value="1"><input type="hidden" name="id" value="<?php echo $id; ?>"><input type="hidden" name="ps" value="<?php echo $ps; ?>">
</form></center></div>
<?php
@odbc_close($connid);
}
?>
</body>
</html>
Java Asp PHP .Net XML C/C++ CGI VB Jsp J2ee J2se J2me EJB Servlet Tomcat Resin Struts Weblogic Eclipse ANT GUI JMS Web servise IDEA Webphere Hibernate Spring Jboss Applet Swing Socket Javamail Perl Ajax P2P 安全 模式 框架 测试 开源 游戏
Windows XP Windows 2000 Windows 2003 Windows Me Windows 9.x Linux UNIX 注册表 操作系统 服务器 应用服务器