Powerful CGI language

Source: Internet
Author: User
Tags count file upload microsoft sql server odbc printf sybase linux

With the rapid development of interconnection network, web background development has become the focus of development, and fierce commercial competition has prompted people to have higher requirements for web background programs. This article will introduce you to a new type of CGI programming language PHP3, it is easy to learn, with many excellent features, you can easily and quickly write a powerful, fast, and can run at the same time on the Windows,unix,linux platform Web background program, particularly noteworthy is that, Anyone who complies with the GNU Treaty will be free to use and change its source code!

The majority of existing Web daemon applications are written in the following techniques: Perl,c general-purpose CGI language directly to write (translate) CGI programs or take advantage of the Web server's own APIs (such as ISAPI,NSAPI) or a third-party solution (such as asp,coldfushion) Although each type of program has its own strengths, it is not an ideal solution.

Perl writes CGI is the most used method, there are also a number of ready-made scripts available on the web that can be modified, but there is a recognized performance problem: As the Web server runs, it needs to invoke interpreter parsing code, and when the number of visitors to the site surges, the performance of the Web server is bound to plummet. In addition, its database connection function is very weak, in some cases, even reduce the access speed of the database; C compiling CGI and ISAPI,NSAPI technology has been greatly increased in speed and has been used by most large web sites for some time, but for its very nature (writing complex, The weak database and the API only for specific Web servers have not been able to be used on a large scale; On the basis of this, Third-party vendors have proposed a better solution: such as the ColdFusion of Microsoft's active SERVER Pages,allaire, They all have features such as fast running and powerful database operations, and are popular with many developers, but they can only run on individual platforms (NT), for sites that require a higher response rate (most medium and large sites are built on UNIX or Linux platforms, The Apache Series Web server is still not going well (note: There are already people who have proposed these two technologies for use on UNIX series platforms, but either do not have all the good features of the source technology, or just apply to individual UNIX platforms).

In 1997, the PHP development team developed a new PHP3 based on the original PHP/FI 2.0 and placed it under the GNU Treaty (same as Linux), allowing everyone to use and/or change the interpreter's source code for free. Compared to the traditional CGI language, PHP3 has the following superior features:

A Easy to learn and use: Most of the grammatical structure of PHP3 borrowed C,java,perl good grammar framework, with the above programming experience developers can quickly grasp the actual input. In the PHP3 package, there are extremely detailed installation instructions, anyone can follow the instructions to quickly configure their own Web server, even on the PHP3 site directly download the PHP3 module of the Web server.

Let's list a few pieces of PHP3 code:

1. Function DefaultHandler ($parser, $data)
{
if (substr ($data, 0,1) = = "&" && substr ($data, -1,1) = = ";"
{printf (' <font color= "#aa00aa" >%s</font> ", Htmlspecialchars ($data));

}else
{printf (' <font size= "-1" >%s</font> ", Htmlspecialchars ($data));
}}

1. Class Foo {
Function Do_foo () {
Echo "doing foo.";
}}
$bar =new foo;
$bar->do_foo ();
1. Function Test () {
Static $count = 0;
$count + +;
echo $count;}

What do you think? Does it look familiar?

Two Run fast: PHP3 using HTML built-in markup technology (similar to the current popular ASP, suffix PHP3), the interpreter itself as a Web server module running, a considerable increase in the Run-time parsing speed (currently only support the Apache Webserver module mode, According to the PHP development team's plan, the interpreter can be run as a plug-in of the Web server in the future, and the data submitted from the page form automatically becomes the variable of the same table Single-name in the program, without the need to manually assign the value. The test shows that when the Web site traffic is very large, PHP3 parsing speed is equivalent to 4 times times the traditional CGI program! Very suitable for medium and large site applications.

Three Across multiple platforms: currently PHP3 can operate on Windows,unix,linux Web server, support Iis,apache and other common Web servers, users change the platform, without changing PHP3 code, can be used.

Four Extremely powerful database support: PHP3 directly for many databases to provide the original connection, including oracle,sybase,postgres,mysql,informix,dbase,solid,access, etc. (through the SYBASE-CT drive, More high-speed access to Microsoft SQL SERVER-------the Protocol is compatible) fully supports the ODBC interface, so that any database that supports ODBC interfaces, PHP3 can provide strong support. And these database operations are included in the PHP3, no other attachments involved, in practical applications, can be faster than any background technology to the database access performance.

Five Advanced expansion Features: PHP3 not only built-in file upload, password authentication, cookies operation, mail transceiver, dynamic GIF generation and other functions of support, but also very far-sighted to provide the gzip file, Pdf,xml Direct support, Users can also write their own extension modules (or download other modules written by others from the Web, Kikuyu) to provide a great deal of space for future extensions.

Six Completely free, support: PHP3 is in compliance with the GNU Treaty, anyone can use the treaty free of charge and rewrite the source code, users can also through the PHP3 site, mailing list and other ways to obtain support, here to mention is: The network has been specifically opened PHP3 support site, code Exchange site, A large number of supporters have also developed a number of powerful base libraries, allowing people to call (at PHP3 's authoritative site, with PHP3 's detailed manual, FAQ, and other information to download)

Due to PHP3 's many outstanding functions, more and more foreign sites have begun to use it for background development (as of April 99, 600,000 sites have been used for development). Some people in the country also began to try to use, got a very good effect, we have reason to believe that such a good CGI language, will be large-scale spread out to become a powerful tool for us to develop.

Attached: Some network resources of PHP3:

1. Www.php.net
The PHP development team site, which has a detailed description of all aspects of PHP3, and can download PHP3 execution
Documents, source code, manuals, FAQs, etc.

2. Px.sklar.com
Specifically for the PHP3 Code Exchange site, listed above by Category A large number of PHP3 source, the content is extremely
Rich, some can be directly applied without modification.

3. Www.phpbuilder.com
PHP3 Development Support Station, the development of troubleshooting, skills, progress, mailing list subscriptions, can be found here
To.

4. Php.codebase.org/content/default/index.html
Very good resource station, not only has a lot of source code, skills, but also has several forum discussion, must go to see


5. phplib.shonline.de/
A powerful PHP3 Kikuyu, the most widely used in the development of PHP3.

6. php.netvision.net.il/examples/
code example with a large number of PHP3

8. www.magicw3.com.cn
Early in the domestic use of PHP3 service providers, there are some PHP3 information.

9. www.job.net.cn
Chinese site, the background procedures are all written in PHP3.

In addition, in the major search engines with PHP keyword search, will also get a lot of information about PHP3 and site




Contact Us

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: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.