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

📄 show.php

📁 某自制区政府网站源代码.数据库为Access,包含完整的数据库.
💻 PHP
字号:
<?php

// ------------------------------ -------- ------------------------------ //

require ("../include/config.inc.php");
require ("./global.php");

// ------------------------------ -------- ------------------------------ //

mysql_connect($dbhost,$dbuser,$dbpasswd) or die ("数据库连接失败");


// check cookie
islogin($HTTP_COOKIE_VARS[$cookie_name][1],$HTTP_COOKIE_VARS[$cookie_name][2]);

$cookie_user = $HTTP_COOKIE_VARS[$cookie_name][1];


// 验证
if ($isshow>"0" && $isshow<"999999999"):
isshow_pass($isshow);
echo "<a href=\"show.php?id=$isshow\">已通过验证, 点击这里返回</a>";
echo "<META HTTP-EQUIV=REFRESH CONTENT='0;URL=show.php?id=$isshow'>";
exit;
endif;

// ------------------------------ -------- ------------------------------

include ("../include/header.inc.php");

// ------------------------------ -------- ------------------------------


if ($id>"0" && $id<"999999999"):


$sql = "SELECT * FROM $ym_article_table WHERE id=$id";
$result = mysql_db_query($dbname, $sql);
$row = mysql_fetch_array($result);
$date = date($datetxt,$row[date]);


// 获取分类名称
$typesql = "SELECT * FROM $ym_article_sort_table WHERE id=$row[sortid]";
$typeresult = mysql_db_query($dbname, $typesql);
$obj = mysql_fetch_object($typeresult);
$sortname = $obj->name;


// 添加计数
$newdaynum = date("Ymd");
if ($newdaynum != $row[daynum]):
$new_today_view = "1";
else:
$new_today_view = $row[today_view]+1;
endif;

$new_view = $row[view]+1;

$sql = "UPDATE $ym_article_table SET today_view=$new_today_view,view=$new_view,daynum=$newdaynum WHERE id=$id";
mysql_db_query($dbname,$sql);



// 显示记录
echo "<title>$row[title]</title>";
echo "<center><br><br>";

echo "<table width=735 border=0>\n";
echo "<tr><td width=100% align=center>\n";
echo "<font style=\"font-family:宋体; font-size: 35px\">$row[title]</font>\n";
echo "<br>\n";

if (!$row[isshow] == "1"):
echo "[<a href=\"./show.php?isshow=$id\" title=\"该篇文章还未通过验证, 点击同意显示\">通过验证</a>] \n";
endif;

echo "[<a href=\"./edit.php?id=$id\">编辑</a>] \n";
echo "[<a href=\"./delete.php?id=$id\">删除</a>]\n";
echo "<hr width=95%>\n";
echo "作者:$row[author] &nbsp;来源:$row[fromsite] &nbsp;类别:$sortname \n";
echo "&nbsp;日期:$date &nbsp;今日/总浏览: $new_today_view/$new_view\n";

if (!$row[download] == ""):
echo "<a href=\"../file/$row[download]\" target=_blank>";
echo "<img border=0 src=\"../images/zip.gif\" title=\"下载 $row[download]\"></a> \n";
endif;

echo "</td></tr>\n";
echo "<tr><td width=100% align=center>\n";

echo "<table width=95% border=0>\n";
echo "<tr><td width=100% height=200 valign=top>\n";

echo "<p style='line-height:130%'>\n";

if (!$row[img] == ""):
echo "<img src=../img/".$row[img]." align=left>";
endif;

echo "  ";

$text = $row[text];

// 格式化文章内容
if ($row[ishtml] == 0):
$text = htmlspecialchars($text);
$text = str_replace("\n", "<br>", $text);
$text = str_replace("  ", "&nbsp;", $text);
endif;

echo $text;

echo "</td></tr></table>\n";

echo "<table width=95% border=0>\n";
echo "<tr><td width=80%>\n";
echo "</td>\n";
echo "<td width=20%>\n";
echo "<br>作者: $row[author]\n";
echo "<br>来源: $row[fromsite]\n";
echo "</td></tr></table>\n";

echo "</td></tr>\n";
echo "<tr><td width=100% align=center>\n";
echo "文章版权归原作者所有, 未经允许请勿转载, 如有任何问题请联系我们.\n";
echo "<hr width=95%>\n";
echo "</td></tr></table>\n";
echo "<br><br>";


else:

echo "<p><center><a href=./list.php>无记录</a></p>";
echo "<META HTTP-EQUIV=REFRESH CONTENT='0;URL=list.php'>";

endif; // id

mysql_close();

// ------------------------------ -------- ------------------------------ //

include ("../include/footer.inc.php");

// ------------------------------ -------- ------------------------------ //

?>

⌨️ 快捷键说明

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