简体   繁体   English

在PHP-JavaScript中实现消息传递服务

[英]Implementing messaging service in PHP-JavaScript

I have a intranet web database application in a LAMP environment. 我在LAMP环境中有一个Intranet Web数据库应用程序。 I would like to implement an internal messaging service like e-mail but just for the users in my application. 我想实现内部消息传递服务,例如电子邮件,但仅针对应用程序中的用户。 I don't want any code just the general idea on how can something like this be implemented. 我不希望任何代码只是有关如何实现此类内容的一般想法。 I'm not very strong in JavaScript but I always learn whatever I don't know. 我不太擅长JavaScript,但是我总是学任何我不知道的东西。

  1. make database table called messages. 使数据库表称为消息。 (id, body, time, author) (id,正文,时间,作者)
  2. Make an HTML form with textarea and submit, action can be the same PHP page or other. 使用textarea创建HTML表单并提交,动作可以是同一PHP页面或其他页面。 (I prefare same page idea.) (我认为是同一网页的想法。)
  3. once the form is submitted, sanitize data for database and create variable which will hold the text from the textarea. 提交表单后,请清理数据库数据并创建变量,该变量将保存文本区域中的文本。
  4. insert this text in messages table. 将此文本插入到消息表中。
  5. then some JavaScript-PHP code which will display all the messages from the database below, next to or above the form. 然后是一些JavaScript-PHP代码,这些代码将在表单下方或上方显示来自数据库的所有消息。 If you have any questions, feel free to ask! 如果你有任何问题随时问!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM