search
HomeBackend DevelopmentPHP Tutorialsandisksecureaccess PHP+ACCESS article management program code

Copy the code The code is as follows:


session_start();
//============================
//Author: biyuan
//Time :2006.07
//Contact: QQ6010707
//============================
?>

Biyuan Network PHP+ACCESS article management system




//================== =================
//Connect to the database
//========================== =========
@$conn = new com("ADODB.Connection");
$conn->Open("DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" . realpath("article.mdb"));
//====================================
// Article navigation
//==================================
function article_menu(){
global $conn;
@$sql = "Select * From List";
@$rs = $conn->Execute($sql);
while(!$rs->Eof){
echo "| Fields[2]->value . "">" . $rs->Fields[1]->value . " ";
$rs ->MoveNext();
}
echo "| Backend Managementrn";
$rs->Close();
if(@ $_SESSION["ARTICLEADMIN"] == "BY_PHP_ARTICLE"){
echo "
Administrative Options-> | Category Management | Publish article | Article list | Log out";
}
}
//============================== =====
//Article list: article_list (article category ID)
//================================ ====
function article_list($str){
global $conn;
@$sql = "Select id,by_title,by_name,by_time,by_count From Article Where by_class = " . $str . " Order By id desc";
@$rs = $conn->Execute($sql);
if(!$rs->Eof){
echo "rn"
. " rn"
. " rn"
. " rn";
while(!$rs->Eof ){
echo " rn"
. " rn"
. " rn";
$rs->MoveNext();
}
echo "< ;/table>rn";
}
else {
echo "
This category does not exist or there are currently no articles!";
}
$rs->Close();
}
//==================================
//文章详细:article_look(文章ID)
//==================================
function article_look($str){
global $conn;
@$sql = "Select * From Article Where id = " . $str;
@$rs = $conn->Execute($sql);
@$usql= "Update Article Set by_count = (by_count + 1) Where id = " . $str;
$conn->Execute($usql);
if(!$rs->Eof){
@$body = $rs->Fields[5]->value;
$body = str_replace("[url=file://%22,%22%22,$body/]\","",$body[/url]);
echo "
Article Title Article Author Published time Number of views
Fields[0]->value . "">" . $rs->Fields[1]->value . " " . $rs->Fields[2]->value . " " . date("Y-m-d H:i:s",$rs->Fields[3]->value) . " " . $rs->Fields[4]->value . "
rn"
. " rn"
. " rn"
. " rn"
. " rn"
. " rn"
. " rn"
. " rn"
. " rn"
. " rn"
. " rn"
. " rn"
. " rn"
. "
" . $rs->Fields[1]->value . "
文章作者:" . $rs->Fields[2]->value . " | 发表时间:" . date("Y-m-d H:i:s",$rs->Fields[3]->value) . " | 浏览次数:" . $rs->Fields[4]->value . "
" . $body . "
返 回 】  【 打 印 】  【 关 闭
rn"
. " rn";
}
else {
echo "
该文章不存在或已被管理员删除!";
}
$rs->Close();
}
//==================================
//后台:分类管理
//==================================
function admin_class(){
global $conn;
@$sql = "Select * From List";
@$rs = $conn->Execute($sql);
echo "
rn";
while(!$rs->Eof){
echo "类别:Fields[1]->value . "" name="class_" . $rs->Fields[0]->value . "" /> 编号:Fields[2]->value . "" name="class_cid_" . $rs->Fields[0]->value . "" /> Fields[0]->value . "';submit();" /> Fields[0]->value . "';submit();" />
rn";
$rs->MoveNext();
}
echo "类别: 编号:  rn"
. "
rn";
//增加一个类别
if(@$_GET["class"] == "add"){
if(@$_POST["class_name"] == "" || @$_POST["class_cid"] == ""){
echo "
填写不完整!";
echo "";
exit();
}
else {
@$sql = "Insert into List(by_list,by_cid) Values('" . $_POST["class_name"] . "' , '" . $_POST["class_cid"] . "')";
$conn->Execute($sql);
echo "
添加成功!";
echo "";
}
}
//修改一个类别
if(@$_GET["class"] == "edit"){
if(@$_POST["class_" . $_GET["id"]] == "" || @$_POST["class_cid_" . $_GET["id"]] == ""){
echo "
填写不完整!";
echo "";
exit();
}
else {
@$sql = "Update List Set by_list = '" . $_POST["class_" . $_GET["id"]] . "' , by_cid = '" . $_POST["class_cid_" . $_GET["id"]] . "' Where id = " . $_GET["id"];
$conn->Execute($sql);
echo "
修改成功!";
echo "";
}
}
//删除一个类别
if(@$_GET["class"] == "del"){
@$sql = "Delete From List Where id = " . $_GET["id"];
$conn->Execute($sql);
echo "
删除成功!";
echo "";
}
}
//==================================
//后台:发表文章(支持HTML)
//==================================
function admin_insert(){
global $conn;
if(@$_GET["innert"] == "add"){
if(@$_POST["title"] == "" || @$_POST["name"] == "" || @$_POST["class"] == "" || @$_POST["body"] == ""){
echo "
填写不完整!";
echo "";
exit();
}
else {
@$body = $_POST["body"];
$body = str_replace("'", "''", $body);
$body = str_replace("\r\n", "
", $body);
@$sql = "Insert into article(by_title,by_name,by_time,by_count,by_body,by_class) Values('" . $_POST["title"] . "' , '" . $_POST["name"] . "' , #" . date("Y-m-d G:i:s") . "# , 0 , '" . $body . "' , '" . $_POST["class"] . "')";
$conn->Execute($sql);
echo "
添加成功!";
echo "";
}
}
else {
echo "
\r\n"
. "
\r\n"
. "文章标题:
\r\n"
. "文章作者:
\r\n"
. "文章类别:
\r\n"
. "文章正文:
\r\n"
. "
 
\r\n"
. "
\r\n"
. "
rn";
}
}
//==================================
//后台:文章列表
//==================================
function admin_list(){
global $conn;
@$sql = "Select id,by_title,by_name,by_time,by_count,by_class From Article Order By id desc";
@$rs = $conn->Execute($sql);
if(!$rs->Eof){
echo "rn"
. " rn"
. " rn"
. " rn";
while(!$rs->Eof){
@$sql = "Select * From List Where by_cid = " . $rs->Fields[5]->value;
@$crs = $conn->Execute($sql);
@$cid = $crs->Fields[1]->value;
echo " rn"
. " rn"
. " rn";
$crs->Close();
$rs->MoveNext();
}
echo "
文章标题 文章分类 文章作者 发表时间 浏览次数 操作
Fields[0]->value . "">" . $rs->Fields[1]->value . " " . $cid . " " . $rs->Fields[2]->value . " " . $rs->Fields[3]->value . " " . $rs->Fields[4]->value . " Fields[0]->value . "">编辑 | Fields[0]->value . "">删除
rn";
}
else {
echo "
该分类不存在或暂时没有任何文章!";
}
$rs->Close();
//修改文章
if(@$_GET["list"] == "edit"){
if(@$_GET["edit"] == "true"){
if(@$_POST["title"] == "" || @$_POST["name"] == "" || @$_POST["class"] == "" || @$_POST["body"] == ""){
echo "
填写不完整!";
echo "";
exit();
}
else {
@$body = $_POST["body"];
$body = str_replace("'", "''", $body);
$body = str_replace("rn", "
", $body);
@$sql = "Update article Set by_title = '" . $_POST["title"] . "' , by_name = '" . $_POST["name"] . "' , by_count = " . $_POST["count"] . " , by_body = '" . $body . "' , by_class = '" . $_POST["class"] . "' Where id = " . $_GET["id"];
$conn->Execute($sql);
echo "
修改成功!";
echo "";
}
}
else {
@$sql = "Select * From Article Where id = " . $_GET["id"];
@$rs = $conn->Execute($sql);
echo "
rn"
. "
fields[0]->value . "" method="post">rn"
. "文章标题:fields[1]->value . "" />
rn"
. "文章作者:fields[2]->value . "" />
rn"
. "浏览次数:fields[4]->value . "" />
rn"
. "文章类别:
\r\n"
. "\r\n"
. "文章正文:
\r\n"
. "
 
\r\n"
. "
\r\n"
. "
\r\n";
}
}
//删除文章
if(@$_GET["list"] == "del"){
@$sql = "Delete From Article Where id = " . $_GET["id"];
$conn->Execute($sql);
echo "
删除成功!";
echo "";
}
}
//==================================
//权限验证
//==================================
function admin_session(){
if(@$_SESSION["ARTICLEADMIN"] != "BY_PHP_ARTICLE"){
echo "
请先登陆!";
echo "";
exit();
}
}
//==================================
//后台登陆
//==================================
function admin_login(){
if(@$_SESSION["ARTICLEADMIN"] == "BY_PHP_ARTICLE"){
echo "";
}
else{
echo "\r\n"
. " \r\n"
. " \r\n"
. " \r\n"
. " \r\n"
. " \r\n"
. " \r\n"
. " \r\n"
. " \r\n"
. "
管理员登陆
\r\n";
}
}
//==================================
//登陆验证
//==================================
function admin_check(){
if(trim($_POST["adminPass"]) != "admin"){
echo "
错误的密码!";
echo "";
}
else {
echo "
登陆成功!";
@$_SESSION["ARTICLEADMIN"] = "BY_PHP_ARTICLE";
echo "";
}
}
//==================================
//URL参数列表
//==================================
function page_load(){
@$classid = $_GET["classid"];
if($classid != ""){
if(!is_numeric($classid)){
echo "
错误的参数!";
return false;
}
else {
article_list($classid);
}
}
@$artid = $_GET["artid"];
if($artid != ""){
if(!is_numeric($artid)){
echo "
错误的参数!";
return false;
}
else {
article_look($artid);
}
}
@$admin = $_GET["admin"];
if($admin == "login"){
admin_login();
}
if($admin == "check"){
admin_check();
}
if($admin == "admin"){
admin_session();
echo "
登陆成功!请选择功能菜单进行操作.";
}
if($admin == "logout"){
session_destroy();
echo "
已成功退出!";
echo "";
}
if($admin == "class"){
admin_session();
admin_class();
}
if($admin == "insert"){
admin_session();
admin_insert();
}
if($admin == "list"){
admin_session();
admin_list();
}
if($classid == "" && $artid == "" && $admin == ""){
echo "";
}
}
?>




文章分类-> =article_menu();?>

=page_load();?>
$conn->Close();
?>


The above introduces the sandisksecureaccess PHP+ACCESS article management program code, including the content of sandisksecureaccess. I hope it will be helpful to friends who are interested in PHP tutorials.

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
Working with Flash Session Data in LaravelWorking with Flash Session Data in LaravelMar 12, 2025 pm 05:08 PM

Laravel simplifies handling temporary session data using its intuitive flash methods. This is perfect for displaying brief messages, alerts, or notifications within your application. Data persists only for the subsequent request by default: $request-

cURL in PHP: How to Use the PHP cURL Extension in REST APIscURL in PHP: How to Use the PHP cURL Extension in REST APIsMar 14, 2025 am 11:42 AM

The PHP Client URL (cURL) extension is a powerful tool for developers, enabling seamless interaction with remote servers and REST APIs. By leveraging libcurl, a well-respected multi-protocol file transfer library, PHP cURL facilitates efficient execution of various network protocols, including HTTP, HTTPS, and FTP. This extension offers granular control over HTTP requests, supports multiple concurrent operations, and provides built-in security features.

Simplified HTTP Response Mocking in Laravel TestsSimplified HTTP Response Mocking in Laravel TestsMar 12, 2025 pm 05:09 PM

Laravel provides concise HTTP response simulation syntax, simplifying HTTP interaction testing. This approach significantly reduces code redundancy while making your test simulation more intuitive. The basic implementation provides a variety of response type shortcuts: use Illuminate\Support\Facades\Http; Http::fake([ 'google.com' => 'Hello World', 'github.com' => ['foo' => 'bar'], 'forge.laravel.com' =>

12 Best PHP Chat Scripts on CodeCanyon12 Best PHP Chat Scripts on CodeCanyonMar 13, 2025 pm 12:08 PM

Do you want to provide real-time, instant solutions to your customers' most pressing problems? Live chat lets you have real-time conversations with customers and resolve their problems instantly. It allows you to provide faster service to your custom

PHP Logging: Best Practices for PHP Log AnalysisPHP Logging: Best Practices for PHP Log AnalysisMar 10, 2025 pm 02:32 PM

PHP logging is essential for monitoring and debugging web applications, as well as capturing critical events, errors, and runtime behavior. It provides valuable insights into system performance, helps identify issues, and supports faster troubleshoot

Explain the concept of late static binding in PHP.Explain the concept of late static binding in PHP.Mar 21, 2025 pm 01:33 PM

Article discusses late static binding (LSB) in PHP, introduced in PHP 5.3, allowing runtime resolution of static method calls for more flexible inheritance.Main issue: LSB vs. traditional polymorphism; LSB's practical applications and potential perfo

Customizing/Extending Frameworks: How to add custom functionality.Customizing/Extending Frameworks: How to add custom functionality.Mar 28, 2025 pm 05:12 PM

The article discusses adding custom functionality to frameworks, focusing on understanding architecture, identifying extension points, and best practices for integration and debugging.

Framework Security Features: Protecting against vulnerabilities.Framework Security Features: Protecting against vulnerabilities.Mar 28, 2025 pm 05:11 PM

Article discusses essential security features in frameworks to protect against vulnerabilities, including input validation, authentication, and regular updates.

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

SAP NetWeaver Server Adapter for Eclipse

SAP NetWeaver Server Adapter for Eclipse

Integrate Eclipse with SAP NetWeaver application server.

PhpStorm Mac version

PhpStorm Mac version

The latest (2018.2.1) professional PHP integrated development tool

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

MantisBT

MantisBT

Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

VSCode Windows 64-bit Download

VSCode Windows 64-bit Download

A free and powerful IDE editor launched by Microsoft