Php + xml message board example tutorial 1-PHP source code

Source: Internet
Author: User
Ec (2); It's okay today. The company also wants to write a php xml parsing program. Let's take a look at it on the Internet and write it out to share it with you, let's take a look at the message page first. & lt ;? Phpinclude_once (& quot; class. php & quot;); $ HawkXMLnewMessage_XML (); $ Action $ _ GET [& quot; Action & quot;];? & Gt; & lt; html script ec (2); script

Today it's okay. The company also wants to write a php xml parsing program. After reading it online, I think it's good to write it and share it with you. Let's take a look at the message page first.

Include_once ("class. php ");
$ HawkXML = new Message_XML ();
$ Action = $ _ GET ["Action"];
?>






Php + xml message book


Php + xml message book


"> [Posting a message]"> [displaying a message] [clearing a message]




Switch ($ Action)
{
Case "show_message": // display the message
$ HawkXML-> show_message ();
Break;
Case "post_message": // Add a message to submit
$ HawkXML-> post_message ();
Break;
Case "add_message": // Add a message
$ HawkXML-> add_message ($ _ POST ['subobject'], $ _ POST ['content']);
Break;
Case "clear_message ":
$ HawkXML-> clear_message ();
Break;
Case "delete_message": // delete a message
$ AutoID = $ _ GET ['autoid'];
$ HawkXML-> delete_message ($ AutoID );
Break;
Case "edit_message": // modify the message
$ AutoID = $ _ GET ['autoid'];
$ HawkXML-> edit_message ($ AutoID );
Break;
Case "save_message": // modify message submission
$ AutoID = $ _ GET ['autoid'];
$ HawkXML-> save_message ($ AutoID, $ _ POST ['subobject'], $ _ POST ['content']);
Break;
Default: // The default message is displayed.
$ HawkXML-> show_message ();
Break;
}
?>



Finally, we can paste the xml document format.


265634001218784833 Test message 1 Test message 1 Test message 1 140627001218784843 Test message 2 Test messages 2 test messages 2 test messages 2 test messages 2 test messages 2 test messages 2 test messages 2 test messages 2 test messages 2 test messages 2 test messages 2 test messages 2 078128001218784850 Test message 3 Test message 3 Test message 3 Test message 3 765628001218784857 Test message 4 Test messages 4 test messages 4 test messages 4 test messages 4 test messages 4 test messages 4 test messages 4 test messages 4 test messages 4 test messages 4

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.