Developer on Alibaba Coud: Build your first app with APIs, SDKs, and tutorials on the Alibaba Cloud. Read more ＞
Everyone knows that the most popular programming method in JAVA is the MVC model. If you do not know the concept of MVC, you can search for it online and find N more materials immediately. After PHP5 was launched, it began to use the MVC model for development. It seems that MVC is indeed very attractive!
During my development of ASP projects, I also used this JAVA development mode for reference. Although the implementation is not very good, it also made the code structure much clearer, greatly facilitating the artist to modify the program!
The following is my code. For more information, see annotations.
The main implementation of the program is the operations of the background administrator: add, delete, modify
There are two programs: adminusers_class.asp and adminusers_gl.asp.
It is equivalent to a servlet and a bean in JAVA! So we didn't fully implement MVC, just simulated it!
The adminusers_class.asp code is as follows:
Rem page function: Website background administrator management class
Rem @ author Cai Xiaoliang
Rem @ version 1.0
Rem @ date 2005-2-22
<! -- # Include file = "conn. asp" -->
Private Sub Class_Initialize
Set ASO = Server. CreateObject ("Adodb. RecordSet ")
Private Sub Class_Terminate
Set ASO = Nothing
Public Function AdminUsers_Add (adminuser_name, adminuser_password, admingroup_id, adminuser_realname, adminuser_selfconfig, adminuser_isshow, adminuser_language)
SQL = "select adminuser_name from ce_adminusers where adminuser_name = '" & adminuser_name &"'"
ASO. Open SQL, conn, 1, 3
If ASO. RecordCount <> 0 then
Response. Redirect ("messages. asp? Mess_name = DATA_ADD_FAILURE & back_page = adminusers_gl.asp? Action = add ")
If ASO. RecordCount = 0 then
SQL = "insert into ce_adminusers (adminuser_name, adminuser_password, login, adminuser_realname, login, adminuser_isshow, adminuser_language) values ('" & adminuser_name & "', '" & adminuser_password &"', "& admingroup_id &", '"& adminuser_realname &"', '"& adminuser_selfconfig &"', '"& adminuser_isshow &"', '"& adminuser_language &"')"
This article is an English version of an article which is originally in the Chinese language on aliyun.com and is provided for information purposes only. This website makes no representation or warranty of any kind, either expressed or implied, as to the accuracy, completeness ownership or
reliability of the article or any translations thereof. If you have any concerns or complaints relating to the article, please send an email, providing a detailed description of the concern or
complaint, to email@example.com. A staff member will contact you within 5 working days. Once verified, infringing content will be removed immediately.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
and provide relevant evidence. A staff member will contact you within 5 working days.