建站极客
网络编程 PHP编程 正文
聊天室php&mysql(一)
所属分类:
网络编程 / PHP编程
阅读数:
1779
收藏 0
赞 0
分享
//第一个页面 name="index1.php" <? 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聊天室 :::</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>很抱歉!这是一个分帧页面,但由于你的浏览器不支持,所以不能浏览! </p> <p>Sorry!This page uses frames,but your browser doesn't support them .</p> </body> </noframes> </html>
PHP利用Mysql锁解决高并发的方法 这篇文章主要介绍了PHP利用Mysql锁解决高并发的方法,小编觉得挺不错的,现在分享给大家,也给大家做个参考。一起跟随小编过来看看吧
评论 0
收藏 0
赞 0
分享
php 后端实现JWT认证方法示例 这篇文章主要介绍了php 后端实现JWT认证方法示例,小编觉得挺不错的,现在分享给大家,也给大家做个参考。一起跟随小编过来看看吧
评论 0
收藏 0
赞 0
分享
PHP命名空间与自动加载类详解 这篇文章主要介绍了PHP命名空间与自动加载类,结合实例形式详细分析了php自动加载类与命名空间原理、使用方法及相关操作注意事项,需要的朋友可以参考下
评论 0
收藏 0
赞 0
分享
PHP时间处理类操作示例 这篇文章主要介绍了PHP时间处理类,结合实例形式分析了DateTime、DateTimeZone、DateInterval及DatePeriod等常用日期时间处理类简单操作技巧,需要的朋友可以参考下
评论 0
收藏 0
赞 0
分享
利用PHP扩展Xhprof分析项目性能实践教程 XHProf是Facebook开发的性能调试工具,能帮助直观的统计显示PHP程序执行中各方法函数调用次数和消耗时间,以方便我们排查性能瓶颈并进行调优。下面这篇文章主要给大家介绍了关于利用PHP扩展Xhprof分析项目性能实践的相关资料,需要的朋友可以参考下
评论 0
收藏 0
赞 0
分享
PHP使用pdo实现事务处理操作示例 这篇文章主要介绍了PHP使用pdo实现事务处理操作,结合实例形式较为详细的分析了php基于pdo实现事务处理的相关原理与操作技巧,需要的朋友可以参考下
评论 0
收藏 0
赞 0
分享
查看更多