A tutorial on the basic _php of WAP and PHP programming

Source: Internet
Author: User
Tags php programming
The development of WAP can not be separated from its www, after all, the entire WAP protocol has been developed in reference to the WWW model, and as far as possible the use of many Internet standards and technologies, such as the WML language derived from HTML and XML (standardization is getting closer), WMLScript is similar to the traditional scripting language. Indeed, WAP is a term, but it is inextricably linked to the traditional internet, structurally so, and technically so.
  
In the WAP protocol, the markup language used to refer to WAP pages is WML, and when more advanced operations are needed, such as using the WMLScript scripting language, which is simple or even trivial to describe, in particular, they can be almost powerless to manipulate the database. This "flaw" and WAP broad business and application prospects are incompatible, but we are not powerless, due to the integration of WAP and WWW, we can still use WWW technology and resources to solve the database access problems, because after all, most of the database is still in the wired network.
  
What is currently the most popular web programming language and database collocation? I believe many people will say "PHP (as the mainstream development language now)" and "MySQL (and PHP collocation of the best combination)" two names. They belong to the category of WWW or wired Internet, because of the use of convenient and powerful features and reputation spread, then they can be used for WAP services? The answer is yes. Not familiar with WAP or PHP (as the mainstream development of the current language) may be somewhat puzzled, after all, in the traditional PHP (as the mainstream development language now) is the content and service of WWW, for WAP, they can be "compatible"?

PHP (as the current mainstream development language) coarse solution

Read the introduction of WAP, we should begin to understand PHP (as the mainstream development language now) why the WAP service can still be. PHP (as the current mainstream development language) and HTML, WML, Javascript, Java are not the same, it is running on the server side, and Javascript, Java and so on are running on the browser side, relative to the Wap,wmlscript run on the client side, but, All of these languages can be easily combined with PHP, which is now the mainstream development language.

PHP (which is now the mainstream development language) has great flexibility, and in www, it can generate whatever HTML code is needed, even JavaScript code. Similarly, in WAP, we can still use PHP (as the current mainstream development language) This dynamic, flexible features, generate arbitrary WML code, so that PHP (as the current mainstream development language) can naturally be used for WAP services.
  
The use of PHP (as the current mainstream development language) to provide WAP services, in addition to its flexible features, but also because of PHP (as the current mainstream development language) can easily use the database. Users can access Oracle (a large Web site database platform), Sybase, MS SQL, MySQL (and the best combination of PHP collocation), DBase, Informix, and any ODBC-compliant database using PHP (as the current mainstream development language). This caters to the needs of WAP business.

In practice, it is generally necessary to build PHP (as the current mainstream development language) file, when the user to the server to browse the PHP (as the current mainstream development language) file request, the server will be based on the code in the file generated the corresponding HTML or WML content, and sent to the browser or WAP terminal.
For information about PHP, which is now the mainstream development language, you can go to http://www.php (now the mainstream development language). com view.

PHP (as the current mainstream development language)-WML

PHP (as the current mainstream development language) of the system platform, working methods, installation methods, these are not covered in this article, after all, our focus is PHP (as the mainstream development language now) how to work with WAP. In general, in order for PHP to work as a mainstream development language, we need a Web server with PHP (as the current mainstream development language) module, or a server that supports PHP (as the current mainstream development language), Apache ( The most popular Web server platform on the UNIX platform is the most popular Web server in the world, and we also need to install PHP (as the current mainstream development language) software and databases such as MySQL (and the best combination of PHP) to read about books or websites. Here we discuss how to generate WML code for PHP, which is now the mainstream development language.
  
In WWW, the first line of PHP (which is now the mainstream development language) is often: content-type:text/html
  
However, the WAP terminal is not read such a title. WAP terminal from the server to download the unit is deck, browse the unit is card, generally a deck to form a WML file. Then, for WAP service, PHP (as the current mainstream development language) files often need to include the following code:

Header ("CONTENT-TYPE:TEXT/VND.WAP.WML");
echo " "
echo "! DOCTYPE WML public "-//wapforum//dtd WML 1.1//en" "Http://www.wapforum.org//DTD//wml_1.1.xml (standardization getting closer)" > ";

The above three lines of code produce the file header of the WML file (Deck) so that the WAP terminal can identify whether the downloaded Deck is in WML format and then display the remaining Deck content.
  
Here is the simplest deck, which displays "Hello World" on a WAP terminal.

http://www.bkjia.com/PHPjc/508638.html www.bkjia.com true http://www.bkjia.com/PHPjc/508638.html techarticle The development of WAP can not be separated from its www, after all, the entire WAP protocol has been developed in reference to the WWW model, and as far as possible to follow the Internet's many standards and technologies, such as WML language derived from H ...

  • Related Article

    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.