首页  >  文章  >  后端开发  >  在线短消息收发的程序,不用数据库_PHP教程

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

WBOY
WBOY原创
2016-07-21 16:07:03638浏览

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);
        ?>        
这只是个简单的例子,更多的修饰就靠你自己了!

www.bkjia.comtruehttp://www.bkjia.com/PHPjc/315166.htmlTechArticlelogin.php ?if(isset($submit)){ session_start(); $nickname=$name; session_register(nickname); header(location:hframe.php); }? form name=form1 action=login.php method=post input type=...
声明:
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn