search
HomeDatabaseMysql Tutorial用Dreamweaver MX+ACCESS制作企业新闻系统

如果在程序中,看到有错误的地方,请到我站点提出(http://www.rushanren.com),我将马上修改! 在开发动态网站的时候,总是发现很多朋友问我要新闻系统,我总是给他们指出到这down到那down,但是很快他们就不满意的回来Q我了,告诉这个太大,那个太大,这个不会改,


  如果在程序中,看到有错误的地方,请到我站点提出(http://www.rushanren.com),我将马上修改!
  
   在开发动态网站的时候,总是发现很多朋友问我要新闻系统,我总是给他们指出到这down到那down,但是很快他们就不满意的回来Q我了,告诉这个太大,那个太大,这个不会改,那个也不会改.在这里,我写这篇DWMX+access开发动态新闻教程,就是为了帮助那些朋友,授人以鱼总是不如授人以渔嘛!
   不废话了,进入正题:

  首先给大家看看这个新闻界面:

   用Dreamweaver MX+ACCESS制作企业新闻系统

  后台管理页面:

   用Dreamweaver MX+ACCESS制作企业新闻系统

  为了方便在这里给大家直观目录:

   用Dreamweaver MX+ACCESS制作企业新闻系统

  具有的功能为:
  1.带后台管理员功能;
  2.每条新闻具有发布时间和浏览次数;
  3.能输入HTML代码,解决英文自动换行功能;
  4.后台具有删除,编辑功能;
  5.尽量精简代码,书写规范简单明了;

  不足的地方:
  1.由于时间关系和对初学者的考虑我没有做分页功能,如果大家想学习,我会在下次教程写出来!
  2.没有写出首页调用代码,也是为初学者考虑
  3.对后台添加新闻表单没有验证

  开发工具:
  DreamweaverMX和Access2000

  好了,大家准备好了吧,我相信如果大家仔细看教程大约5小时就可以明白整个开发原理,很简单的:
  先给大家说说开发步骤(或许不太规范,是按照本人习惯)

  1.规划定义站点,建立各个功能模块文件。
 好了,咱们开始吧,一个好的站点,应该先规划好站点文件的存放!

  好了先看看文件目录:

   用Dreamweaver MX+ACCESS制作企业新闻系统

  下面解释一下:

  目录:admin(用于存放后台管理程序文件)
  文件:
  xh_add.asp (后台管理页面)
  xh_edit.asp (后台编辑页面)
  xh_del.asp (后台删除页面)
  xh_login.asp (后台管理登陆页面)
  xh_cklogin.asp (后台管理验证页面)
  xh_loginout.asp (后台管理退出页面)
  xh_write.asp (新闻添加页面)
  xh_save.asp (添加新闻验证页面)
  xh_conn.asp (数据库连接文件)

  目录:date (存放数据库文件)
  目录:images (存放图片)

  主目录下文件:
  index.asp (新闻首页面)
  conn.asp (数据库连接文件)
  xh_look.asp (新闻查看页面)
  xh_wei.asp (include连接结尾页面)

  好了具体的规划就是这些,大家应该能明白一个步骤了吧!
  也是一个思考过程,建站--建立各功能目录--建立数据库--建立后台文件--建立显示记录页面---完善程序例如编辑删除功能

  2.用Access写数据库xhnew.mdb

  这次咱们就来做这个新闻系统的数据库,放心很简单,几分钟就可以搞定!

  首先开发ACCESS,设计表,如下图:

   用Dreamweaver MX+ACCESS制作企业新闻系统

  在这里,我详细介绍一下各个数据类型的功能
  name用来存放新闻发布者的姓名(文本)
  content 用来存放新闻内容(切记设置为备注,因为储存量多)
  title 新闻标题(文本)
  xhcount 存放每条记录点击数(数字型)
  xhtime 每条新闻发布时间(时间类型)

  在此在说明一下conn.asp文件,就是数据库连接文件

   用Dreamweaver MX+ACCESS制作企业新闻系统

  大家能看明白嘛?第一句声明DB为数据名。
  然后打开ADO,这个是规范写法,对于数据库移动位置可以在server.mappath改。

  3.写后台管理登陆页面xh_login.asp和xh_cklogin.asp还有退出管理页面xh_loginout.asp

  这次,准备讲解这个后台登陆的几个页面!

  xh_login.asp这个页面主要一个表单递交页面,递交到xh_cklogin.asp

   用Dreamweaver MX+ACCESS制作企业新闻系统

  xh_cklogin.asp是个验证表单密码的页面。

   用Dreamweaver MX+ACCESS制作企业新闻系统

  好了,咱们来分析这段代码。

<br>name=trim(request.Form("username"))<br>pass=trim(request.form("password")) <br>

  主要是从login.asp提取2个表单的值

<br>if name="" or pass="" then<br>response.write "" <br>end if<br>

  主要就是验证输入的用户名和密码是否是空值,这个参数是从登陆框传递过来的!记得我们给xh_login.asp的各个控件赋予了名称

<br>if name="adminxh" and pass="adminxh" then<br>session("xianhe")="yes"<br>response.redirect "xh_add.asp"<br>else<br>response.write ""<br>end if<br>

  主要就是验证密码是否正确了,如果正确进入下个页面,不正确返回登陆页面!在这里主要要提的是,这么一句代码。

<br>session("xianhe")="yes"<br>

  这句代码非常的重要,就是这个会话可以防止别人非法登陆你的后台页面,在下节在着重讲解,在这里你只要明白,我把这个会话赋值为"yes"

  xh_loginout.asp是个退出管理的跳转页面,只有2行代码

   用Dreamweaver MX+ACCESS制作企业新闻系统

  第一行是消除会话的值
  第二行是跳转页面代码

[1] [2] 

用Dreamweaver MX+ACCESS制作企业新闻系统

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
Explain the InnoDB Buffer Pool and its importance for performance.Explain the InnoDB Buffer Pool and its importance for performance.Apr 19, 2025 am 12:24 AM

InnoDBBufferPool reduces disk I/O by caching data and indexing pages, improving database performance. Its working principle includes: 1. Data reading: Read data from BufferPool; 2. Data writing: After modifying the data, write to BufferPool and refresh it to disk regularly; 3. Cache management: Use the LRU algorithm to manage cache pages; 4. Reading mechanism: Load adjacent data pages in advance. By sizing the BufferPool and using multiple instances, database performance can be optimized.

MySQL vs. Other Programming Languages: A ComparisonMySQL vs. Other Programming Languages: A ComparisonApr 19, 2025 am 12:22 AM

Compared with other programming languages, MySQL is mainly used to store and manage data, while other languages ​​such as Python, Java, and C are used for logical processing and application development. MySQL is known for its high performance, scalability and cross-platform support, suitable for data management needs, while other languages ​​have advantages in their respective fields such as data analytics, enterprise applications, and system programming.

Learning MySQL: A Step-by-Step Guide for New UsersLearning MySQL: A Step-by-Step Guide for New UsersApr 19, 2025 am 12:19 AM

MySQL is worth learning because it is a powerful open source database management system suitable for data storage, management and analysis. 1) MySQL is a relational database that uses SQL to operate data and is suitable for structured data management. 2) The SQL language is the key to interacting with MySQL and supports CRUD operations. 3) The working principle of MySQL includes client/server architecture, storage engine and query optimizer. 4) Basic usage includes creating databases and tables, and advanced usage involves joining tables using JOIN. 5) Common errors include syntax errors and permission issues, and debugging skills include checking syntax and using EXPLAIN commands. 6) Performance optimization involves the use of indexes, optimization of SQL statements and regular maintenance of databases.

MySQL: Essential Skills for Beginners to MasterMySQL: Essential Skills for Beginners to MasterApr 18, 2025 am 12:24 AM

MySQL is suitable for beginners to learn database skills. 1. Install MySQL server and client tools. 2. Understand basic SQL queries, such as SELECT. 3. Master data operations: create tables, insert, update, and delete data. 4. Learn advanced skills: subquery and window functions. 5. Debugging and optimization: Check syntax, use indexes, avoid SELECT*, and use LIMIT.

MySQL: Structured Data and Relational DatabasesMySQL: Structured Data and Relational DatabasesApr 18, 2025 am 12:22 AM

MySQL efficiently manages structured data through table structure and SQL query, and implements inter-table relationships through foreign keys. 1. Define the data format and type when creating a table. 2. Use foreign keys to establish relationships between tables. 3. Improve performance through indexing and query optimization. 4. Regularly backup and monitor databases to ensure data security and performance optimization.

MySQL: Key Features and Capabilities ExplainedMySQL: Key Features and Capabilities ExplainedApr 18, 2025 am 12:17 AM

MySQL is an open source relational database management system that is widely used in Web development. Its key features include: 1. Supports multiple storage engines, such as InnoDB and MyISAM, suitable for different scenarios; 2. Provides master-slave replication functions to facilitate load balancing and data backup; 3. Improve query efficiency through query optimization and index use.

The Purpose of SQL: Interacting with MySQL DatabasesThe Purpose of SQL: Interacting with MySQL DatabasesApr 18, 2025 am 12:12 AM

SQL is used to interact with MySQL database to realize data addition, deletion, modification, inspection and database design. 1) SQL performs data operations through SELECT, INSERT, UPDATE, DELETE statements; 2) Use CREATE, ALTER, DROP statements for database design and management; 3) Complex queries and data analysis are implemented through SQL to improve business decision-making efficiency.

MySQL for Beginners: Getting Started with Database ManagementMySQL for Beginners: Getting Started with Database ManagementApr 18, 2025 am 12:10 AM

The basic operations of MySQL include creating databases, tables, and using SQL to perform CRUD operations on data. 1. Create a database: CREATEDATABASEmy_first_db; 2. Create a table: CREATETABLEbooks(idINTAUTO_INCREMENTPRIMARYKEY, titleVARCHAR(100)NOTNULL, authorVARCHAR(100)NOTNULL, published_yearINT); 3. Insert data: INSERTINTObooks(title, author, published_year)VA

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

WebStorm Mac version

WebStorm Mac version

Useful JavaScript development tools

EditPlus Chinese cracked version

EditPlus Chinese cracked version

Small size, syntax highlighting, does not support code prompt function

PhpStorm Mac version

PhpStorm Mac version

The latest (2018.2.1) professional PHP integrated development tool

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

SublimeText3 English version

SublimeText3 English version

Recommended: Win version, supports code prompts!