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.