Php uses smarty for simple message system

Source: Internet
Author: User
The message is an example I used in php before. now I use the smarty template as the message. this is an example I used in php before. now I use the smarty template as the message.

This is probably the case.

 Query($sql);$smarty->assign("liuyan",$attr);$smarty->display("liuyan.html");

Html

Write the table format and traverse the database data.

The code is as follows:

 Untitled DocumentMessage page

Publish information
Exit System

<{Foreach $ liuyan as $ v}> <{/Foreach}>
Sender Sending time Recipient Information content Operation
<{$ V [1]}> <{$ V [2]}> <{$ V [3]}> <{$ V [4]}> "> Delete

This is how it works.

 display("fabu.html");

Because the publishing page does not need to use a database or anything, you only need to display the html file, so there are two sentences of code.

Html file

 Untitled Document

View information
Exit System

Message sending

This page is displayed.

 Query ($ SQL);?>
 Query ($ SQL); if ($ r) {header ("location: liuyan. php");} else {echo "failed to add" ;}?>

This is probably done. the deletion of the information system is not done. in the previous blogs, you only need to add a processing page.

Run the command again to check whether the sender will be removed after the last release is completed.

Run

The content you just wrote will appear in the table.

Running successful

The above is the detailed content of php's simple message system using smarty. For more information, see other related articles in the first PHP community!

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.