Php: Details on PHP subrelease operation instance 1

Source: Internet
Author: User
Php: Let's take a closer look at the PHP article release operations Example 1 article release example, because the first two chapters are string processing and regular expressions, so the focus is on using this content. First, post. php file & lt; formmethod & quot; post & quot; action & quot; viewthread. php & quot; target & quot; _ blank & quot; & gt; & l php: Details on PHP article release operation instance 1

This example shows the release of the article. because the first two chapters are string processing and regular expressions, the focus is on using these content.

First, the post. php file

Simple: purely html code. three pieces of information must be submitted and transmitted using the post method. $ _ POST ["subject"], $ _ POST ["message"], $ _ POST ["parse"] Note that the [] of parse [] cannot be removed because an array is submitted.

The submitted information will be sent to viewthread. php.

  GetSubject (); // call the method for obtaining the title in the document object, and the output file title echo ""; // output a separator line, used to separate the title and body content of an article echo $ article-> getMessage (); // call the method of getting the content of the article in the article object and output the content of the article subject?>

It is easy to do, but we can see how a general project is developed. HaoGe calls this interface. The principle is very simple. you only need to include this class, by calling its method, we can implement the functions we need, which is convenient and well encapsulated. large projects are split into several interfaces, and each interface does what we should do, when one person does a few jobs and then calls each other between interfaces, big projects can be basically formed.


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.