Online short message sending and receiving program without database

Source: Internet
Author: User
Program | data | database | online login.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=text name= "Name" >
<input type=submit name=submit value= "Enter" >
</form>
hframe.php
<frameset cols= "0,*" >
<frame name= "Contents" src= "autosend.php" >
<frame name= "main" src= "smessage.php" >
<noframes>
<body>

<p> This page uses frames, but your browser does not support frames. </p>

</body>
</noframes>
</frameset>
smessage.php
<?session_start ();
if (Isset ($submit)) {
$FP =fopen ("Test.txt", "A +");
$temp = "\ r \ n". $rmessage. "|". $content. "|". $nickname. "| 0 ";
Fputs ($fp, $temp);
Exit
}
?>
: <form name=form1 action= "smessage.php" method= "POST" >
Receiving party <input Type=text name=rmessage><br>
Content: <br><textarea name=content rows=20 cols=30>
</textarea><br>
<input Type=submit Name=submit value=submit>
</form>
? Session_Start ();
echo "<meta http-equiv= ' refresh ' content= ' 6;url=autosend.php ' >";
$FL =file ("test.txt");
$temp = "";
for ($i =0; $i <count ($FL); $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);
?>
This is just a simple example, more modification on your own!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.