Chatting Room php & amp; mysql (III)

Source: Internet
Author: User

Third page 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 = "everyone ";
$ K = 1 ;}

$ Select = "select row from user_message order by row DESC ";
$ Result = mysql_query ($ select) or die ("false fgg ");
$ 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 = "everyone"; $ 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?> ">
Description
<Input type = "hidden" name = "p" value = "1">
<Input type = "text" name = "message" size = "30">
<Input type = "submit" name = "OK" value = "send">
</P>
<P> <font color = "# 6699FF">. </font>
<Select name = "action1">
<Option selected value = ""> speak </option>
<Option value = "quietly"> quietly </option>
<Option value = "happy"> happy </option>
<Option value = "Smile"> smile </option>
<Option value = "Ha! Ha! Ha! Smile "> laugh </option>
<Option value = "Smile"> smile </option>
<Option value = "Smile"> smile </option>
<Option value = "margin"> margin </option>
<Option value = "pouting"> pouting </option>
<Option value = "crying soon"> crying soon </option>
<Option value = "Boxing"> boxing </option>
<Option value = "malicious"> malicious </option>
<Option value = "sorry"> sorry </option>
<Option value = "wide-eyed, very different"> wide-eyed </option>
<Option value = "happy"> happy </option>
<Option value = "rummaging cabinet location"> rummaging cabinet </option>
<Option value = "sadly"> sorrow </option>
<Option value = "Smile"> smile </option>
<Option value = "drool"> drool </option>
<Option value = "awesome"> awesome </option>
<Option value = "Angry"> angry </option>
<Option value = "Loud"> loud </option>
<Option value = "dumb"> dumb </option>
<Option value = "a payment is satisfactory"> satisfying </option>
<Option value = "helpless"> helpless </option>
<Option value = "innocent"> innocent </option>
<Option value = "muttering"> muttering </option>
<Option value = "staring"> blinking </option>
<Option value = "coming soon"> vomit </option>
<Option value = "Uncomfortable"> uncomfortable </option>
<Option value = "listless"> listless </option>
<Option value = "reluctantly"> reluctantly </option>
<Option value = "spitting out white foam"> white foam </option>
<Option value = "cannot conceal ecstasy"> ecstasy </option>
<Option value = "Smile"> gongshu </option>
<Option value = ""> prepare </option>
<Option value = "cough! Sighs "> sighs </option>
<Option value = ""> sorry </option>
<Option value = "looking out of the window, you can't help but see your eyes."> sadness </option>
<Option value = "cry"> tears </option>
<Option value = "think of sadness, tears like a note"> cry </option>
<Option value = "cry"> cry </option>
<Option value = "fear..."> fear </option>
<Option value = "very strange"> strange </option>
<Option value = "blinking"> blinking </option>
<Option value = "giggling, generous"> generous </option>
<Option value = "blushing on your face,"> blushing </option>
<Option value = "angrily"> angry </option>
<Option value = "Raise your voice"> loud </option>
<Option value = "when you have enough air to stop drinking"> stop drinking </option>
<Option value = "confused"> confused </option>
<Option value = "reluctantly shrugged"> shrugged </option>
<Option value = "hitting your own brain"> brain shoot </option>
<Option value = "talking to others, boring"> bored </option>
<Option value = "Gu Zuo meditation"> meditation </option>
<Option value = "an innocent look"> innocent </option>
<Option value = "Uncomfortable"> discomfort </option>
</Select>
Color
<?
$ Blue = "blue"; $ black = "black"; $ red = "red"; $ yellow = "yellow"; $ zi = "Purple "; $ green = "green"; $ qing = "green ";
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"> blue </option>
<Option value = "#000000"> black </option>
<Option value = "# FF0000"> Red </option>
<Option value = "# FFFF00"> yellow </option>
<Option value = "#800080"> purple </option>
<Option value = "#008000"> green </option>
<Option value = "#00CC00"> Qing </option>
</Select>
Private Chat
<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 "> action expression </div>
<Div id = "Layer4" style = "position: absolute; left: 412px; top: 49px; width: 73px; height: 24px; z-index: 4 "> <a href =" javascript: changnick () "> rename </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 () "> Leave the chat room </a> </div>
<Div id = "Layer6" style = "position: absolute; left: pixel PX; top: 6px; width: 32px; height: 20px; z-index: 6 "> right </div>

<Div id = "Layer7" style = "position: absolute; left: pixel PX; top: 82px; width: 427px; height: 19px; z-index: 7">
<Div align = "center"> <font color = "# FF0000"> 2001 @ copyright <a href = "mailto: xiaoyanglg@263.net & quot;> FEIT boys studio </a> </font> </div>
</Div>
</Div>
</Body>
</Html>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.