?? del.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 + -