PHP: A copy of the PHP script release operation Example 1

Source: Internet
Author: User
PHP: About PHP Article release operation Example 1

The article publishes an example of this, because the first two chapters are string processing and regular expressions, so the emphasis is on these things.

First of all, post.php this file.

 

 
very simple, pure HTML code, to submit three messages, with the POST method, $_post["subject"], $_post["message"],$_ Post["Parse"] special attention to parse[] [] cannot be removed because an array is being committed.

The submitted information is then passed to viewthread.php

"!--? Phprequire "acticle_class.php"; Include the script file acticle_class.php, import the article class into the file//create an article object, pass in the title of the article in the construction method, the main content of the article and the user's action options $article=new acticle ($_post["   Subject "], $_post[" message "],$_post[" Parse "]); Echo $article--->getsubject ();               Call the Get caption method in the article object, the output file's title echo "";  Outputs a divider line that separates the title and subject content of the article echo $article->getmessage (); Call the article object in the method of obtaining the content of the article, output the main content of the article? 

What it does is very simple, but we can see the general project how to develop, Hao elder brother Call this interface, the reason is very simple, you just include this class, Call its method can achieve the function we need, much convenience, encapsulation is also very good, large projects split into several interfaces, each interface do their own things, a person do a few, and then the interface between the call, the big point of the project can be basically molded.


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