In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article introduces the knowledge of "how to delete the message board in php". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!
Php to achieve message board deletion function: 1, create update.php files; 2, through the "public function delete () {require_once 'config.inc.php'...}" method to achieve message board deletion function.
This article operating environment: Windows7 system, PHP7.1 version, DELL G3 computer
How to delete the message board with php?
When PHP realizes the function of Mini Program message board, it can only modify and delete its own messages.
PHP implements Mini Program message board function.
Here I have implemented a message that can only be modified and deleted, as shown in the following figure
This is the addition of new features done in the previous article, and I will not talk any more nonsense, sending modified and added code.
Logs.wxml
Message content: submit message user name: {{item.uname}} content: {{item.content}} modify and delete
Logs.js
Page ({data: {}, / * Life cycle function-- listen for page loading-get values from other pages received by line * / onLoad: function (options) {this.setData ({id:options.id, uid: options.uid) Uname: options.uname}) var that = this that.setData ({uids:that.data.uid}) wx.request ({url: 'http://127.0.0.1/liuyanban.php', data: {' content-type': 'application/json'}, header: {' content-type': 'application/json'}, method:' GET', dataType: 'json' Success: function (res) {that.setData ({liuyantext: res.data ['0'],}) console.log ('query value', res.data ['0'])},})} Liuyanban: function (e) {if (e.detail.value.content! = "") {var that = this wx.request ({url: 'http://127.0.0.1/liuyanban.php', data: {"uid": this.data.uid, "uname": this.data.uname, "content": e.detail.value.content} Header: {'content-type':' application/x-www-form-urlencoded'}, method: 'POST', dataType:' json', success: function (res) {console.log ('insert data value:', res)},})} console.log ('message content', e.detail.value.content) console.log ('uid:' This.data.uid) console.log ('uname:', this.data.uname)}, deletei: function (e) {wx.showModal ({title:' prompt', content: 'confirm deletion', success (res) {if (res.confirm) {wx.request ({url: 'http://127.0.0.1/update.php',) Method: "get", header: {'content-type':' application/json'}, dataType:'json', data: {'content-type':' application/json' 2, 'id': e.currentTarget.dataset.src} Success:function () {wx.showToast ({title: 'deleted successfully', icon: 'none' })}) console.log ('user Click OK')} else if (res.cancel) {console.log ('user Click cancel')})},})
Here, I would like to say that the query message and post message PHP of the last article has not changed. An additional modification page and a PHP file have been added. The modification page is shown in the following figure.
Then there is the modification page and PHP, and the deletion is placed on the post message page, but the background file is linked to the modification page.
Update.wxml
Content: modifyin
Update.js
Page ({data: {}, onLoad: function (options) {this.setData ({id: options.id,}) var that = this wx.request ({url: 'http://127.0.0.1/update.php', data: {' asides: 1, 'id':that.data.id}) Header: {'content-type':' application/json'}, method: 'GET', dataType:' json', success: function (res) {that.setData ({updatei: res.data,}) console.log ('query value', res.data)},})} Update:function (e) {wx.showToast ({title: 'modified successfully', icon: 'none',}) wx.request ({url:' http://127.0.0.1/update.php', method: "GET", header: {'content-type':' application/json'}, data: {"id": this.data.id "content": e.detail.value.content}, dataType:'json', success:function (res) {wx.navigateBack ({delta: 1})}) console.log ('content',e.detail.value.content)},})
Update.php
This is the end of the content of "how to delete the message board in php". Thank you for your reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.