Php does not POST but outputs data after refreshing. Solution

Source: Internet
Author: User
My php code is as follows: & lt; html & gt; & lt; head & gt; & lt; meta & nbsp; http-equiv = "Content-Type" & nbsp; content = "text/htm php refresh without POST, but output data
My php code is as follows:



Network Message Board


// Error_reporting (E_ALL &~ E_NOTICE );
Function write_message ($ file_name, $ message)
{
$ Fp = fopen ($ file_name, "a"); // open the file in append mode.
If (flock ($ fp, LOCK_EX ))
{
Fwrite ($ fp, $ message );
Flock ($ fp, LOCK_UN );
}
Else
{
Echo "file cannot be locked
";
}
Fclose ($ fp); // Close File Resources
}

// Customize a function to traverse and read files
Function read_message ($ file_name)
{
$ Fp = fopen ($ file_name, "r"); // open the file in read-only mode
Flock ($ fp, LOCK_SH );
$ Buffer = "";

While (! Feof ($ fp ))
{
$ Buffer. = fread ($ fp, 1024 );
}

$ Data = explode ("<|>", $ buffer );
Unset ($ data [count ($ data)-1]);
Foreach ($ data as $ line)
{
$ Arr = explode ("|", $ line );
List ($ user_name, $ title, $ message) = $ arr;
If ($ user_name! = "" & $ Title! = "" & $ Message! = "")
{
Echo $ user_name. '';
Echo "". $ title .'';
Echo $ message ." ";
}
}

Flock ($ fp, LOCK_UN );
Fclose ($ fp );
}

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.