程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
 程式師世界 >> 編程語言 >> 網頁編程 >> PHP編程 >> PHP綜合 >> 聊天室php&mysql(三)

聊天室php&mysql(三)

編輯:PHP綜合
第三個頁面 name="frame3.php"


<?
include "../signup/mysql.php";
//echo $userid;
//echo $private;
if($p)$p=1;
else $p=0;

if(($action="ok")and($p)){

$sql="select userid,id from chat_user_list where userid='$userid'";
$result=mysql_query($sql);
$roww=mysql_fetch_array($result);
$userrr=$roww["id"];





$sql="select userid,id from chat_user_list where id='$object'";
$result=mysql_query($sql);
if($row1=mysql_fetch_array($result))
$object=$row1["userid"];
else {
    $object="大家";
    $k=1;}      

$select="select row from user_message order by row DESC";
        $result=mysql_query($select)or die(" false fgfg");
        $rowlist=mysql_fetch_array($result)or die("false fgs");
        $max_row=$rowlist["row"];

$row=$max_row+1;
$time1=date("G:i");


$sql="INSERT INTO user_message (userid,object,message,status,action1,color,row,time1) values('$userid','$object','$message','$private','$action1','$color','$row','$time1')";

mysql_query($sql)or die(mysql_error());

if($k){$object="大家"; $private=0;}
else
$object=$row1["id"];
}

?>
<html>
<head>
<title>input table</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">


<SCRIPT LANGUAGE="JavaScript">
<!--
function user(user){

document.form1.object.value=user;
}

function changnick(){
window.open("changnick.php?userid=<?echo $userid ;?>","changnick","toolbar=no,directories=no,menubar=no,width=800,height=570,width=340,height=220,status=0");
}

//-->
</SCRIPT>

</head>

<body bgcolor="#6699FF" text="#000000">

<div id="Layer1" style="position:absolute; left:125px; top:4px; width:498px; height:79px; z-index:1">  
  <form name="form1" method="post" align="center" action="<? echo $PHP_SELF; ?>?action=ok">
    <p> <font color="#6699ff">.</font>  
      <input type="text" name="object" size="10" value="<?echo $object?>">
      <input type="hidden" name="userid" value="<?echo $userid ?>">
      說  
      <input type="hidden" name="p" value="1">
      <input type="text" name="message" size="30">
      <input type="submit" name="ok" value="發送">
    </p>
    <p> <font color="#6699FF">.</font>  
      <select name="action1">
        <option selected value="說">說話</option>
        <option value="悄悄地">悄悄</option>
        <option value="興高采烈地">高興 </option>
        <option value="微微笑著">微笑 </option>
        <option value="哈!哈!哈!地笑著">大笑三聲 </option>
        <option value="笑嘻嘻">嘻笑 </option>
        <option value="奸笑著">奸笑 </option>
        <option value="毛手毛腳地">毛手毛腳 </option>
        <option value="嘟著嘴">嘟嘴 </option>
        <option value="快要哭著">快要哭 </option>
        <option value="拳打腳踢地">拳打腳踢 </option>
        <option value="不懷好意地">不懷好意 </option>
        <option value="遺憾地">遺憾 </option>
        <option value="瞪大了眼睛,很訝異地">訝異 </option>
        <option value="幸福地">幸福 </option>
        <option value="翻箱倒櫃地">翻箱倒櫃 </option>
        <option value="悲傷地">悲傷 </option>
        <option value="淫淫笑著">淫淫笑 </option>
        <option value="流著口水">流口水 </option>
        <option value="正氣凜然地">正氣凜然 </option>
        <option value="生氣地">生氣 </option>
        <option value="大聲地">大聲 </option>
        <option value="傻乎乎地">傻乎乎 </option>
        <option value="一付很滿足的樣子">很滿足 </option>
        <option value="手足無措地">手足無措 </option>
        <option value="很無辜地">無辜 </option>
        <option value="喃喃自語地">喃喃自語 </option>
        <option value="惡狠狠地瞪著眼">瞪眼 </option>
        <option value="快要吐地">想吐 </option>
        <option value="感到不舒服地">不舒服 </option>
        <option value="無精打采地">無精打采 </option>
        <option value="依依不捨地">依依不捨 </option>
        <option value="吐著白沫地">白沫 </option>
        <option value="掩飾不住狂喜的心情">狂喜 </option>
        <option value="笑呵呵一拱手">拱手 </option>
        <option value="很有禮貌地作了一揖">作揖 </option>
        <option value="咳!慨歎萬千">慨歎 </option>
        <option value="深深地鞠躬">致歉 </option>
        <option value="望著窗外細雨淅淅,不由得雙眼朦胧地">傷感 </option>
        <option value="含淚要哭">含淚 </option>
        <option value="想到傷心處,淚流如注">大哭 </option>
        <option value="抱頭放聲大哭">痛哭 </option>
        <option value="好怕怕呀...">害怕 </option>
        <option value="感到很是奇特">奇特 </option>
        <option value="瞇著小眼睛道">瞇眼 </option>
        <option value="咯咯一笑,很大方的">大方 </option>
        <option value="臉上泛起了紅暈,">臉紅 </option>
        <option value="氣憤地嚷道">生氣 </option>
        <option value="提高嗓門">大聲 </option>
        <option value="運足氣一聲斷喝">斷喝 </option>
        <option value="一臉的迷茫">迷茫 </option>
        <option value="無奈地聳聳肩">聳肩 </option>
        <option value="使勁敲敲自己腦門">拍腦 </option>
        <option value="看著別人談笑,無聊的很">無聊 </option>
        <option value="顧作沉思狀">沉思 </option>
        <option value="一付無辜的樣子">無辜 </option>
        <option value="不舒服地">不適 </option>
      </select>
      顏色  
      <?
      $blue="藍"; $black="黑";$red="紅";$yellow="黃";$zi="紫";$green="綠";$qing="青";
      if($color=="#0000FF")$color1=$blue;
      if($color=="#000000")$color1=$black;
      if($color=="#FF0000")$color1=$red;
      if($color=="#FFFF00")$color1=$yellow;
      if($color=="#800080")$color1=$zi;
      if($color=="#008000")$color1=$green;
      if($color=="#00CC00")$color1=$qing;
      ?>
      <select name="color">
      <option selected value="<?echo $color ;?> "><?echo $color1; ?></option>
       <option value="#0000FF">藍</option>
        <option value="#000000">黑</option>
        <option value="#FF0000">紅</option>
        <option value="#FFFF00">黃</option>
        <option value="#800080">紫</option>
        <option value="#008000">綠</option>
        <option value="#00CC00">青</option>
      </select>
      私聊  
      <input type="checkbox" name="private" value="1" <? if ($private)echo "checked" ; ?>>
    </p>
  </form>
</div>
<div id="Layer2" style="position:absolute; left:34px; top:6px; width:85px; height:24px; z-index:2">  
  <?echo $userrr ;?>
</div>
<div id="Layer3" style="position:absolute; left:68px; top:47px; width:79px; height:25px; z-index:3">動作表情</div>
<div id="Layer4" style="position:absolute; left:412px; top:49px; width:73px; height:24px; z-index:4"><a href="javascript:changnick()">改名</a></div>
<div id="Layer5" style="position:absolute; left:508px; top:48px; width:80px; height:26px; z-index:5"><a href="javascript:parent.window.close()">離開聊天室</a></div>
<div id="Layer6" style="position:absolute; left:116px; top:6px; width:32px; height:20px; z-index:6">對</div>

<div id="Layer7" style="position:absolute; left:108px; top:82px; width:427px; height:19px; z-index:7">  
  <div align="center"><font color="#FF0000">2001 @版權所有 <a href="mailto:[email protected]">FEIT男孩工作室</a></font></div>
</div>
</div>
</body>
</html>
  1. 上一頁:
  2. 下一頁:
Copyright © 程式師世界 All Rights Reserved