Home  >  Article  >  Backend Development  >  What is the idea of ​​deleting this message in php?

What is the idea of ​​deleting this message in php?

藏色散人
藏色散人Original
2021-12-28 09:24:481648browse

php ideas for deleting this message: 1. Introduce the conn.php file; 2. Use the get method to obtain the id; 3. Use sql statements to delete the id.

What is the idea of ​​deleting this message in php?

The operating environment of this article: Windows 7 system, PHP version 7.1, Dell G3 computer.

What is the idea of ​​php deleting this message?

PHP Project: Message Board Development (Delete Function)

del.php

Enter localhost/del.php?id=1

on the address bar
<?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>";
?>

Recommended learning: "PHP Video Tutorial"

The above is the detailed content of What is the idea of ​​deleting this message 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