Home >Backend Development >PHP Tutorial >Chat room php&mysql (1)_PHP tutorial

Chat room php&mysql (1)_PHP tutorial

WBOY
WBOYOriginal
2016-07-21 16:05:22876browse

//第一个页面  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"LOADING ........";
echo "";

}

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"LOADING ........";
echo "";
}


?>


::: FEIT聊天室 :::



  
    
    
    
  
    
    
    
  

  <br><body bgcolor="#FFFFFF" text="#000000"> <br><p>很抱歉!这是一个分帧页面,但由于你的浏览器不支持,所以不能浏览! </p> <br><p>Sorry!This page uses frames,but your browser doesn't support them .</p> <br></body> <br>  
 

www.bkjia.comtruehttp://www.bkjia.com/PHPjc/315752.htmlTechArticle//第一个页面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=ins...
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn