An example of a PHP text message book (v) _php Tutorial

Source: Internet
Author: User
Now let's take a look at the reply.php code:
---------------------------------
reply.php



function Check_strlen_long ($txt)
{
$len =strlen ($txt);
$count = 0;
for ($i =0; $i < $len; $i + +)
{
if (Ord ($txt [$i]) <128)
{$count = $count +1;}
if (Ord ($txt [$i]) ==10 or ord ($txt [$i]) ==32)
{$count = 0;}
if ($count >=60)
{
$txt [$i]= "n";
$count = 0;
}
}
return $txt;
}

function encode ($txt)
{
$txt =strip_tags ($txt);
$txt =htmlspecialchars ($txt);
$message =stripslashes ($txt);
return $message;
}

$content =file ("Guest.txt");
$disptext = $content [$record-1];

if ($job = = "Addreply" and $replyname! = "" and $replycontent! = "")
{
$content =file ("Guest.txt");
$count =count ($content);
$time = Date (y year m D Day h i min);
$ip = $REMOTE _addr;
$replycontent =stripslashes ($replycontent);
$replyname =encode ($replyname);
$replycontent =htmlspecialchars ($replycontent);
$replycontent =check_strlen_long ($replycontent);
$replycontent =nl2br ($replycontent);
$replycontent =ereg_replace (CHR), "", $replycontent);
$content [$record -1]=substr ($content [$record -1],0,strlen ($content [$i])-1); $content [$record -1]= $content [$record-1]. "











------------------
So far, PHP code we have finished, the rest is you want to make a message Ben's head and bottom
You can design any style. But remember to have at least 3 connections on this head: view back Home
e-mail. This system is not complete. But since this is a text message, so you do not have to worry about the database problems, you just write a guest.txt file is complete. Although this message does not have MySQL and so on, But the function is still good. and is completely your own message book. Well, the next section we'll tell you a few important steps to build and upload a message guest.txt.
Not to be continued ...

http://www.bkjia.com/PHPjc/315491.html www.bkjia.com true http://www.bkjia.com/PHPjc/315491.html techarticle now let's take a look at the reply.php code:---------------------------------//reply.php function Check_strlen_long ($txt) {$len = Strlen ($txt); $count = 0; for ($i =0; $i $len; $i + +) {...

  • 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.