Home > Backend Development > PHP Tutorial > 在线短消息收发的程序,不用数据库_PHP

在线短消息收发的程序,不用数据库_PHP

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-01 12:42:46
Original
695 people have browsed it

login.php
    session_start();
    
    $nickname=$name;
    session_register("nickname");
    header("location:hframe.php");    
}?>





hframe.php

  
  
   <br>   <br> <br>   <p>此网页使用了框架,但您的浏览器不支持框架。</p> <br> <br>   <br>   

smessage.php
if(isset($submit)){
     $fp=fopen("test.txt","a+");
     $temp="\r\n".$rmessage."|".$content."|".$nickname."|0";
     fputs($fp,$temp);
     exit;
}
?>

接收方

内容:




session_start();
echo "";
$fl=file("test.txt");
$temp="";
for($i=0;$i     $sflag=explode("|",$fl[$i]);    
    if(($sflag[3]==0)&&$sflag[0]==$nickname){
            
        echo"<script>window.open('list.php?Smessage=$sflag[2]&Content=$sflag[1]','newwin','toolbar=no location=no')</script>";        
    }else{
        $temp.=$fl[$i];
    }
}
$fp=fopen("test.txt","w");
    fputs($fp,$temp);
        ?>        
这只是个简单的例子,更多的修饰就靠你自己了!
Related labels:
Statement of this Website
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
Latest Issues
用phpstorm
From 1970-01-01 08:00:00
0
0
0
Why did the teacher’s submission fail?
From 1970-01-01 08:00:00
0
0
0
composer installation failed
From 1970-01-01 08:00:00
0
0
0
angular.js - angularJS ng-style用法
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template