Home  >  Article  >  Backend Development  >  How to delete message board in php

How to delete message board in php

coldplay.xixi
coldplay.xixiOriginal
2020-08-03 11:00:002623browse

php method to delete message board: first write the [del.php] file and introduce the [conn.php] file; then use the get method to obtain the id data, and use the sql statement to execute the delete statement; finally execute Just end it.

How to delete message board in php

php method to delete message board:

How to delete message board in php

<?php
include &#39;conn.php&#39;;
    $id = $_GET[&#39;id&#39;];
    $query="delete from message where id=".$id;
    mysql_query($query);
?>
//引入conn文件,使用get方式获取id,使用sql语句来删除id
<?php
//页面跳转,实现方式为javascript 
$url = "list.php";
echo "<script>";
echo "window.location.href=&#39;$url&#39;";
echo "</script>";
?> 
//使用js页面跳转回list查看文件的页面

Related learning recommendations: php graphic tutorial

The above is the detailed content of How to delete message board in php. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn