⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 del.php

📁 凌云新闻LyNews v1.0
💻 PHP
字号:
 <html>
 <head>
 <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
 <meta name="GENERATOR" content="Microsoft FrontPage 3.0">
 <title>删除新闻</title>
 </head>
 <body bgcolor="#008080">
 <font COLOR="#000000">
 <h1 align="center"></font><font color="#FFFF00">删除新闻</font></h1>
 <form method="POST" action="del.php">
  <p><font color="#0000FF">请输入新闻序号:</font><input type="text" name="newlx"
  size="5"> <input type="submit" value="确定" name="submit1"></p>
 </form>
 <form method="POST" action="del.php">
  <p><font color="#0000FF">删除<input type="text" name="newts" size="5" value="7">天前的新闻</font>
  <input type="submit" value="确定" name="submit2"></p>
</form>
<?php
if ($submit1)
{
include("header.inc");
$query=mysql_query("delete from news where newxlh='$newlx'");
if ($query)
{
echo "<font color='Blue'>删除成功!!!";
} else {
echo "<font color='yellow'>删除失败???";
}
}
if ($submit2)
{
include("header.inc");
$day1=date("j")-$newts;
$date1=date("Y-m-d",mktime(0,0,0,date("n"),$day1));
$query=mysql_query("select newimg from news where newdate<='$date1'");
while ($array=mysql_fetch_row($query)){
$newimg=trim($array[0]);
if ($newimg != ""){
$file="d:/www/php/img/".$newimg;
if (file_exists($file)){
unlink($file);
}
}
}
$query=mysql_query("delete from news where newdate<='$date1'");
if ($query)
{
echo "<font color='Blue'>删除成功!!!";
} else {
echo "<font color='yellow'>删除失败???";
}
}
?>

</body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -