Chatting Room php & amp; mysql (1)

Source: Internet
Author: User

// Name = "index1.php" on the first page"


<?

Include "../signup/mysql. php ";
$ Time1 = time ();
// $ Userid = 983530409;
Echo $ n;


If ($ n = 1 ){
$ Userid = time ();
$ Nick = "g". $ userid;
$ Last_time = $ userid;
$ SQL = "insert into chat_user (userid, id, last_time) values ('$ userid',' $ nick ',' $ last_time ')";
Mysql_query ($ SQL) or die (mysql_error ());

$ SQL = "insert into chat_user_list (userid, id, last_time) values ('$ userid',' $ nick ',' $ last_time ')";
Mysql_query ($ SQL) or die (mysql_error ());


Echo "<font size = 6 COLOR = # FF0066> <B> LOADING ...... </B> </FONT> ";
Echo "<script language = 'javascript '> window. open ('index1. php? Userid = ". $ userid. "', 'chat', 'toolbar = no, directories = no, menubar = no, width = 800, height = 570, left = 0, top = 0, status = 0 ');";

Echo "window. close () </script> ";

}

If ($ n = 983530409)
{

$ SQL = "select userid, sex, passwd from user where id = '$ N '";
$ Result = mysql_query ($ SQL );
$ Row = mysql_fetch_array ($ result );
$ Nick = $ row ["userid"];
$ Passwd = $ row ["passwd"];
$ Sex = $ row ["sex"];

$ SQL = "insert into chat_user (userid, passwd, sex, last_time, id) values ('$ n',' $ passwd ',' $ sex ',' $ time1 ', '$ nick ')";
Mysql_query ($ SQL) or die (mysql_error ());




Echo "<font size = 6 COLOR = # FF0066> <B> LOADING ...... </B> </FONT> ";
Echo "<script language = 'javascript '> window. open ('index1. php? Userid = ". $ n. "', 'chat', 'toolbar = no, directories = no, menubar = no, width = 800, height = 570, left = 0, top = 0, status = 0 ');";

Echo "window. close (); </script> ";
}


?>
<Html>
<Head>
<Title >::: FEIT chat room ::: </title>
<Meta http-equiv = "Content-Type" content = "text/html; charset = gb2312">
<Script language = "JavaScript">
<! --
Function MM_reloadPage (init) {// reloads the window if Nav4 resized
If (init = true) with (navigator) {if (appName = "Netscape") & (parseInt (appVersion) = 4 )){
Document. MM_pgW = innerWidth; document. MM_pgH = innerHeight; onresize = MM_reloadPage ;}}
Else if (innerWidth! = Document. MM_pgW | innerHeight! = Document. MM_pgH) location. reload ();
}
MM_reloadPage (true );
// -->
</Script>
</Head>
<Frameset cols = "*, 132" frameborder = "NO" border = "0" framespacing = "0" rows = "*">
<Frameset rows = "*, 111" frameborder = "NO" border = "0" framespacing = "0" cols = "*">
<Frame name = "top" src = "index. php? Userid = <? Echo $ userid?> "Scrolling =" AUTO ">
<Frame name = "bottom" scrolling = "NO" noresize src = "frame3.php? Userid = <? Echo $ userid?> ">
</Frameset>
<Frameset rows = "*, 110" frameborder = "NO" border = "0" framespacing = "0">
<Frame name = "right" scrolling = "AUTO" noresize src = "frame2.php? Userid = <? Echo $ userid?> ">
<Frame name = "bottomFrame" scrolling = "NO" noresize src = "frame4.php">
</Frameset>
</Frameset>
<Noframes>
<Body bgcolor = "# FFFFFF" text = "#000000">
<P> sorry! This is a frame splitting page, but it cannot be viewed because your browser does not support it! </P>
<P> Sorry! This page uses frames, but your browser doesn't support them. </p>
</Body>
</Noframes>
</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.