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
Optimize PHP Code: Reducing Memory Usage & Execution TimeOptimize PHP Code: Reducing Memory Usage & Execution TimeMay 10, 2025 am 12:04 AM

TooptimizePHPcodeforreducedmemoryusageandexecutiontime,followthesesteps:1)Usereferencesinsteadofcopyinglargedatastructurestoreducememoryconsumption.2)LeveragePHP'sbuilt-infunctionslikearray_mapforfasterexecution.3)Implementcachingmechanisms,suchasAPC

PHP Email: Step-by-Step Sending GuidePHP Email: Step-by-Step Sending GuideMay 09, 2025 am 12:14 AM

PHPisusedforsendingemailsduetoitsintegrationwithservermailservicesandexternalSMTPproviders,automatingnotificationsandmarketingcampaigns.1)SetupyourPHPenvironmentwithawebserverandPHP,ensuringthemailfunctionisenabled.2)UseabasicscriptwithPHP'smailfunct

How to Send Email via PHP: Examples & CodeHow to Send Email via PHP: Examples & CodeMay 09, 2025 am 12:13 AM

The best way to send emails is to use the PHPMailer library. 1) Using the mail() function is simple but unreliable, which may cause emails to enter spam or cannot be delivered. 2) PHPMailer provides better control and reliability, and supports HTML mail, attachments and SMTP authentication. 3) Make sure SMTP settings are configured correctly and encryption (such as STARTTLS or SSL/TLS) is used to enhance security. 4) For large amounts of emails, consider using a mail queue system to optimize performance.

Advanced PHP Email: Custom Headers & FeaturesAdvanced PHP Email: Custom Headers & FeaturesMay 09, 2025 am 12:13 AM

CustomheadersandadvancedfeaturesinPHPemailenhancefunctionalityandreliability.1)Customheadersaddmetadatafortrackingandcategorization.2)HTMLemailsallowformattingandinteractivity.3)AttachmentscanbesentusinglibrarieslikePHPMailer.4)SMTPauthenticationimpr

Guide to Sending Emails with PHP & SMTPGuide to Sending Emails with PHP & SMTPMay 09, 2025 am 12:06 AM

Sending mail using PHP and SMTP can be achieved through the PHPMailer library. 1) Install and configure PHPMailer, 2) Set SMTP server details, 3) Define the email content, 4) Send emails and handle errors. Use this method to ensure the reliability and security of emails.

What is the best way to send an email using PHP?What is the best way to send an email using PHP?May 08, 2025 am 12:21 AM

ThebestapproachforsendingemailsinPHPisusingthePHPMailerlibraryduetoitsreliability,featurerichness,andeaseofuse.PHPMailersupportsSMTP,providesdetailederrorhandling,allowssendingHTMLandplaintextemails,supportsattachments,andenhancessecurity.Foroptimalu

Best Practices for Dependency Injection in PHPBest Practices for Dependency Injection in PHPMay 08, 2025 am 12:21 AM

The reason for using Dependency Injection (DI) is that it promotes loose coupling, testability, and maintainability of the code. 1) Use constructor to inject dependencies, 2) Avoid using service locators, 3) Use dependency injection containers to manage dependencies, 4) Improve testability through injecting dependencies, 5) Avoid over-injection dependencies, 6) Consider the impact of DI on performance.

PHP performance tuning tips and tricksPHP performance tuning tips and tricksMay 08, 2025 am 12:20 AM

PHPperformancetuningiscrucialbecauseitenhancesspeedandefficiency,whicharevitalforwebapplications.1)CachingwithAPCureducesdatabaseloadandimprovesresponsetimes.2)Optimizingdatabasequeriesbyselectingnecessarycolumnsandusingindexingspeedsupdataretrieval.

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

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

VSCode Windows 64-bit Download

VSCode Windows 64-bit Download

A free and powerful IDE editor launched by Microsoft

DVWA

DVWA

Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software

Atom editor mac version download

Atom editor mac version download

The most popular open source editor

SublimeText3 English version

SublimeText3 English version

Recommended: Win version, supports code prompts!

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor