If you see any error in the program, please submit it to my website (www.rushanren.com) And I will modify it now! When developing dynamic websites, I always find that many of my friends ask me to ask for news systems. I always point them down to that point, but soon they will not be satisfied with me, tell me this is too big, that is too big, this will not be changed,
If you see an error in the program, please go to my site (http://www.rushanren.com) And I will modify it now! When developing dynamic websites, I always find that many of my friends ask me to ask for news systems. I always point them down to that point, but soon they will not be satisfied with me, tell me this is too big, that is too big, this will not be changed,
If you see an error in the program, please go to my site (http://www.rushanren.com) And I will modify it now!
When developing dynamic websites, I always find that many of my friends ask me to ask for news systems. I always point them down to that point, but soon they will not be satisfied with me, tell me this is too big, that is too big, this will not change, that will not change. here, I wrote this dynamic news tutorial on DWMX + access development to help those friends. It is always better to teach fish to fish than to give fish to others!
No nonsense. Go to the question:
First, let's take a look at this news interface:
Background Management page:
For the convenience of giving you an intuitive directory here:
Features:
1. provides the background administrator function;
2. Each piece of news has a publishing time and browsing times;
3. the HTML code can be entered to solve the English line feed function;
4. Deletion and editing functions are available in the background;
5. Try to streamline the code and make the writing standard simple and clear;
Disadvantages:
1. Due to the time relationship and considerations for beginners, I have not implemented the paging function. If you want to learn it, I will write it in the next tutorial!
2. I did not write the homepage call code, which is also for beginners.
3. added a news form to the background without verification
Development tools:
DreamweaverMX and Access2000
Now, you are ready. I believe that if you carefully read the tutorial for about five hours, you can understand the entire development principle, which is very simple:
First, let's talk about the development steps (maybe not standardized, according to my habits)
1. Plan and define the site and create a file for each function module.
Now, let's get started. Plan the storage of site files for a good site!
Now let's take a look at the file directory:
The following explains:
Directory: admin (used to store background management program files)
File:
Xh_add.asp (background management page)
Xh_edit.asp (background editing page)
Xh_del.asp (background Deletion page)
Xh_login.asp (background management logon page)
Xh_cklogin.asp (background management verification page)
Xh_loginout.asp (background management exit page)
Xh_write.asp (News add page)
Xh_save.asp (Add news verification page)
Xh_conn.asp (database connection file)
Directory: date (storing database files)
Directory: images (storing images)
Files in the main directory:
Index. asp (News homepage)
Conn. asp (database connection file)
Xh_look.asp (news view page)
Xh_wei.asp (include connection end page)
Well, the specific plan is like this. You should be able to understand one step!
It is also a process of thinking. Building a website -- creating a functional directory -- creating a database -- creating a background file -- creating a display record page -- Improving programs such as editing and deleting a function
2. Use Access to write database xhnew. mdb
This time, we will create a database for this news system. Don't worry, it's just a few minutes!
First, develop ACCESS and design tables, such:
Here, I will detail the functions of each data type
Name is used to store the name (text) of a news publisher)
Content is used to store news content (remember to set it as remarks because there are many storage resources)
Title news title (text)
Xhcount stores the clicks of each record (number type)
Xhtime each news publication time (time type)
The conn. asp file is the database connection file.
What can we see? In the first statement, the database is the data name.
Then open ADO. This is the standard writing method. You can change the database location in server. mappath.
3. Write back-end management login pages xh_login.asp and xh_cklogin.asp as well as the exit management page xh_loginout.asp
This time, I am going to explain several pages of background login!
The xh_login.asp page mainly contains a form submission page, which is submitted to xh_cklogin.asp.
Xh_cklogin.asp is a page for verifying the form password.
Let's analyze this code.
name=trim(request.Form("username"))
pass=trim(request.form("password"))
It mainly extracts the values of two forms from login. asp.
if name="" or pass="" then
response.write ""
end if
It mainly verifies whether the entered user name and password are null. this parameter is passed from the login box! Remember that we assigned names to the controls in xh_login.asp.
if name="adminxh" and pass="adminxh" then
session("xianhe")="yes"
response.redirect "xh_add.asp"
else
response.write ""
end if
It is mainly to verify that the password is correct. If you enter the next page correctly, the login page is returned incorrectly! Here we mainly mention such a code.
session("xianhe")="yes"
This code is very important, that is, this session can prevent unauthorized access to your background page, which will be explained in the next section, I assigned this session "yes"
Xh_loginout.asp is an exit management jump page with only two lines of code
The first line is to remove the session value.
The second line is page Jump code
[1] [2]