In the early days of website construction and development, people used HTML language to design web pages. These simple HTML documents are manually edited and stored in computers connected to the Internet, and any user connected to the Internet can access the information in them. This form of page is called a static page. Because HTML uses hypertext links, visitors can easily jump from one page to another and realize nonlinear browsing. It is precisely because of this brand-new, more reasonable and more convenient information query method that the unprecedented rapid development of the WEB has been promoted.
With the continuous development of internet technology and the geometric growth of online information, people gradually find that it is a great waste of manpower and material resources to manually write pages containing all information and content, which is almost impossible to achieve. In addition, the site established by static page mode can only transmit the existing pages simply according to the user's request, but can't realize various dynamic interactive functions. Specifically, static pages have obvious shortcomings in the following aspects:
. The background database cannot be supported. With the increasing amount of information on the Internet, there is a growing demand for enterprises and individuals to publish products and information through the Internet, and people increasingly need a way to access the server background database through a simple webpage. This is far from static pages.
. Can't effectively update the website information in time. Users can only change each page one by one if they want to update or modify the content and information of traditional static pages. In the early days of Internet development, when there was little information on the Internet, this practice was still acceptable. But now even netizens' personal websites contain a variety of rich content, so how to update the page information in time and effectively has become an urgent problem to be solved.
. The dynamic display effect cannot be achieved. All static pages are pre-written and cannot be changed, so users who visit the same page will only see the same content, and static pages cannot be displayed differently according to different users.
In order to overcome the shortcomings of static pages, people introduce the traditional programming technology in the stand-alone environment into the combination of Internet and WEB technology, thus forming a new network programming technology. Network programming technology realizes dynamic and personalized communication and interaction between the client and server of the network by adding various programs and logical controls to the traditional static pages. People call this kind of page created by network programming technology dynamic page.
Although there are more and more programming language tools for developing Web applications, their functions are getting stronger and stronger, and their use is getting simpler and simpler, such as the popular ASP(ActiveServerPages)PHP and so on. However, CGI (Universal Gateway Interface) interface program, as an old-timer, still occupies a major position in this server/client interactive Web application. Let's talk about ASP and PHP respectively.
Operation and implementation mechanism of network programming technology
Network programming technology generally adopts scripting language as programming language. Scripting languages have similar grammatical structure and style to traditional programming languages, but traditional programming languages, such as C, VC and VB, are simplified for the convenience of designing network applications. For example, the scripting language allows users not to declare the variable type before using the variable, which is directly determined by the value of the variable, and the variable type can be changed freely during use.
Another notable feature of scripting language is that it can be used with HTML language. Scripting language is very compatible with HTML language. Users can directly add HTML tags to the script code, or they can add the script code to it, so as to better realize page control and provide richer functions. For the simplest example, we can use PHP combined with HTML to achieve the following output:
& lt?
$name=John
Print "< center >;
Print "Hello! $ name ";
Print "& ltBR >;; ;
Print "Welcometothewendfulworldofserver _ sideprogramming!" ;
Print "& lt/CENTER >;;
& gt
The output of the above code is:
Hello! John
welcometothewendfulworldofserver _ side programming!
In order to distinguish the script code and HTML code in the same page, different network programming technologies use different delimiters to include the script code in their own delimiters. For example, ASP code uses the delimiter "
I like HTML pages with suffixes. Html or. Htm ",dynamic pages written with different technologies are also stored in the WEB server. When a client user sends a request to the WEB server to access a dynamic page, the WEB server will determine the network programming technology used by the page according to the suffix of the page accessed by the user, and then submit the page to the corresponding interpretation engine. The interpretation engine scans the whole page, looks for a specific delimiter, executes the script code located in the delimiter, and realizes different functions, such as accessing the database, sending emails, performing arithmetic or logical operations, etc. Finally, the execution result is returned to the WEB server; Finally, the WEB server sends the execution results of the interpretation engine to the client together with the HTML content on the page and various client scripts. Although there is no difference between the page received by the client user and the traditional page, in fact, the page content has been processed by the server and the dynamic personalized setting has been completed.
active server pages
ASP(ActiveServerPages) is a network programming technology introduced by Microsoft. Accurately speaking, ASP is not a programming language, because ASP does not provide its own special programming language, but allows users to write ASP applications using many existing scripting languages, including VBSCRIPT and JAVASCRIPT. Therefore, ASP should actually be a server-side writing environment for scripting languages.
The default scripting language of ASP is VBSCRIPT, but users can choose according to their own needs. Users can use almost all popular scripting languages to write ASP applications as long as they install the corresponding scripting engine.
ASP has absorbed many popular technologies, such as IIS, ACTIVEX, VBSCRIPT, ODBC and so on. , is a mature network application development technology. ASP, with its good compatibility with traditional Microsoft products and easy to learn and use, has gradually occupied the mainstream position of network programming technology once it appeared.
The core technology of ASP is the comprehensive support for component and object technology. By using ASP components and object technology, users can directly use ActiveX controls, call object methods and properties, and realize powerful functions in a simple way.
The most commonly used objects and components in ASP are as follows:
Object:
Request object: Forms, cookies, user authentication information and language style can be used. Users can use powerful, simple and intuitive CFML tags to complete various complex operations just like HTML tags. For the convenience of users, COLDFUSION not only provides a large number of functional labels, but also allows users to create and use various customized labels according to their own needs. It can be said that as long as you master all kinds of CFML tags, it is equivalent to mastering the essence of COLDFUSION technology.
For example, if users want to send e-mail through COLDFUSION technology, they only need to use the.
& ltCFMAIL
TO= "Recipient 1 @ address, Recipient 2 @ address"
FROM= "From @ Address"
CC= "Recipient 3 @ Address"
SUBJECT="theme " >
& lt/cf mail & gt;
except for...
& ltCFQUERY & gt tag: used to set database DNS and execute SQL statements.
& ltCFINPUT & gt tag: used for data input, in addition, it can also provide verification of the validity of the input value.
& ltCFOUTPUT & gt tag: used for the output of numerical values, strings, expressions, etc.
& ltCFIF & gt; and
Server-side programming language (abbreviation of professional hypertext preprocessor)
PHP(HypertextPreprocessor) is the most popular scripting language on the Internet. PHP was first invented by RasmusLerdorf, and then rewritten by a team of six people. Now the latest version is PHP4.0BETA3.
PHP combines the essence of Perl, Java and C language to a great extent, and inherits the style of C language in grammar architecture. As a new scripting language, PHP can provide various powerful functions on the basis of ensuring easy learning and easy use. Different from other network programming technologies, PHP is a free software like LINUX and PERL. This makes PHP more flexible, and people can constantly add new functions to PHP, so that PHP will always be at the forefront of similar technologies.
Compared with ASP, COLDFUSION and other network programming technologies, PHP itself is a scripting language. Therefore, if users really want to master PHP, they should focus on learning and mastering the grammatical structure and functions of PHP.
For example, the process of using PHP to realize a simple logical judgment is as follows:
if($user _ count & gt; 200){
Print "Thesiteisbusyrightnow!" ; }
else if($ user _ count & gt; 100){
Print "Thesiteisactiverightnow Verification Now!" ;
Otherwise {
Print "the site alone-only $ user _ countuserlogging";
}
Write:
Notepad, writing version, dreamweaver can do it.
Now the webpage here is a dynamic webpage.
Dynamic pages generally use databases.