PHP+jquery+ajax实现即时聊天功能实例(2)

<?php
$json = array();
$txt = isset($_GET['txt'])?$_GET['txt']:'';
$type = isset($_GET['type'])?$_GET['type']:'';
if($txt!=''){
 $file = $type.".txt";
 if(file_exists($file)){
  $fp = fopen($file,"a");
  $str = "rn".'Admin:'.$txt;
  //$str = $txt."n"//linux;
  fwrite($fp, $str);
  fclose($fp);
  $json['status']=200;
  echo json_encode($json);
  exit;
 }
}
?>

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:http://www.heiqu.com/e07189cc8102e2953c669f0b5742d4da.html