search
HomeBackend DevelopmentPHP TutorialBasics of WAP and PHP Programming_PHP Tutorial
Basics of WAP and PHP Programming_PHP TutorialJul 13, 2016 pm 05:33 PM
phpwapandformulateprotocoldevelopBaseofprogramming

  WAP的发展离不开其WWW的底蕴,毕竟,整个WAP协议的制定参照了WWW的模型,并且尽可能地沿用了Internet的诸多标准和技术,如WML语言脱胎于HTML与xml(标准化越来越近了),WMLScript与传统的脚本语言也很相似。的确,WAP虽然是个新名词,但是它却与传统的国际互联网密不可分地结合着,在结构上如此,在技术上更是如此。
  
  在WAP协议中提到WAP页面所使用的标记语言为WML,当需要进行较高级的操作,如使用终端机的某些资源时,可以使用WMLScript脚本语言,这两种语言很简单,甚至可以用简陋来形容,特别是它们对数据库的操作几乎无能为力,这种"缺陷"与WAP广阔的商务和应用前景格格不入,但我们并不是无能为力的,由于WAP和WWW的交融,我们仍然可以使用WWW的技术与资源来解决数据库的访问问题,因为毕竟多数数据库仍处于有线网络内。
  
  目前最流行的网页编程语言和数据库的搭配是什么?相信很多人会说出"php(做为现在的主流开发语言)"与"MySQL(和PHP搭配之最佳组合)"这两个名字。它们属于WWW或者有线互联网的范畴,由于使用方便与功能强大的特点而美名传播,那么它们能够为WAP服务吗?答案是肯定的。不熟悉WAP或者php(做为现在的主流开发语言)的人或许有些不解,毕竟在传统意义上php(做为现在的主流开发语言)提供的是WWW的内容与服务,对于WAP,它们能"兼容"吗?

  php(做为现在的主流开发语言)粗解

  看了WAP的介绍,大家应该开始逐步理解php(做为现在的主流开发语言)为何仍能为WAP服务了。php(做为现在的主流开发语言)与HTML、WML、Javascript、Java都不一样,它是在服务器端运行的,而Javascript、Java等都运行在浏览器端,相对于WAP,WMLScript运行于客户机端,但是,以上的这些语言都可以很容易与php(做为现在的主流开发语言)结合起来。   

  php(做为现在的主流开发语言)具有很大的灵活性,在WWW中,它可以生成所需要的任何HTML代码,甚至Javascript代码。同样,在WAP中,我们仍然可以利用php(做为现在的主流开发语言)这种动态、灵活的特点,生成任意的WML代码,这样,php(做为现在的主流开发语言)自然能够为WAP服务。   
  
  之所以使用php(做为现在的主流开发语言)来提供WAP服务,除了它灵活的特点外,还由于php(做为现在的主流开发语言)可以方便的使用数据库。用户可以使用php(做为现在的主流开发语言)存取Oracle(大型网站数据库平台)、Sybase、MS SQL、MySQL(和PHP搭配之最佳组合)、dBase、Informix等任何支持ODBC标准的数据库,这点正好迎合了WAP商务的需求。   

  在实用中,一般需要建立php(做为现在的主流开发语言)文件,当用户向服务器发出浏览该php(做为现在的主流开发语言)文件的请求时,服务器将根据文件中的代码产生相应的HTML或WML内容,并发送给浏览器或WAP终端。   
  如想获取关于php(做为现在的主流开发语言)的信息,可以前往http://www.php(做为现在的主流开发语言).com查看。

  php(做为现在的主流开发语言)-WML

PHP (as the current mainstream development language) ’s system platform, working method, and installation method are not within the scope of this article. After all, our focus is on php (as a Current mainstream development languages)How to collaborate with WAP. Generally speaking, in order to make php(as the current mainstream development language) work, we need a web server with the php(as the current mainstream development language) module, In other words, servers that support 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. In addition, We also need to install php(as the current mainstream development language) software and databases such as MySQL(the best combination with PHP). For specific content, you can refer to relevant books or website. Next we discuss how to make php (as the current mainstream development language) generate WML code.
 
 In the WWW, the first line of content generated by php(as the current mainstream development language) is often: content-type: text/html
 
 However, WAP terminals cannot read such titles. The unit for WAP terminals to download from the server is Deck, and the unit for browsing is Card. Generally, a Deck constitutes a WML file. Then, when serving WAP, the php(as the current mainstream development language) file often needs to contain the following code:

header("Content-type: text/vnd.wap .wml");
echo "<xml(Standardization is getting closer) version="1.01"> "
echo"<! DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN""http://www.wapforum.org//DTD//wml_1.1.xml(standardized Getting closer)"> ";

The above three lines of code generate 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.
 
The following is the simplest Deck, which displays "Hello World" on the WAP terminal

<?xml(Standardization is getting closer) version="1.0" encoding=. "ISO-8859-1"?> <! DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org//DTD//wml_1.1.xml(Standardization is getting closer)">

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/508638.htmlTechArticleThe development of WAP is inseparable from its WWW heritage. After all, the entire WAP protocol was formulated with reference to the WWW model. And it uses many standards and technologies of the Internet as much as possible. For example, the WML language was born out of H...
Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
php怎么把负数转为正整数php怎么把负数转为正整数Apr 19, 2022 pm 08:59 PM

php把负数转为正整数的方法:1、使用abs()函数将负数转为正数,使用intval()函数对正数取整,转为正整数,语法“intval(abs($number))”;2、利用“~”位运算符将负数取反加一,语法“~$number + 1”。

php怎么实现几秒后执行一个函数php怎么实现几秒后执行一个函数Apr 24, 2022 pm 01:12 PM

实现方法:1、使用“sleep(延迟秒数)”语句,可延迟执行函数若干秒;2、使用“time_nanosleep(延迟秒数,延迟纳秒数)”语句,可延迟执行函数若干秒和纳秒;3、使用“time_sleep_until(time()+7)”语句。

php怎么除以100保留两位小数php怎么除以100保留两位小数Apr 22, 2022 pm 06:23 PM

php除以100保留两位小数的方法:1、利用“/”运算符进行除法运算,语法“数值 / 100”;2、使用“number_format(除法结果, 2)”或“sprintf("%.2f",除法结果)”语句进行四舍五入的处理值,并保留两位小数。

php怎么根据年月日判断是一年的第几天php怎么根据年月日判断是一年的第几天Apr 22, 2022 pm 05:02 PM

判断方法:1、使用“strtotime("年-月-日")”语句将给定的年月日转换为时间戳格式;2、用“date("z",时间戳)+1”语句计算指定时间戳是一年的第几天。date()返回的天数是从0开始计算的,因此真实天数需要在此基础上加1。

php字符串有没有下标php字符串有没有下标Apr 24, 2022 am 11:49 AM

php字符串有下标。在PHP中,下标不仅可以应用于数组和对象,还可应用于字符串,利用字符串的下标和中括号“[]”可以访问指定索引位置的字符,并对该字符进行读写,语法“字符串名[下标值]”;字符串的下标值(索引值)只能是整数类型,起始值为0。

php怎么替换nbsp空格符php怎么替换nbsp空格符Apr 24, 2022 pm 02:55 PM

方法:1、用“str_replace(" ","其他字符",$str)”语句,可将nbsp符替换为其他字符;2、用“preg_replace("/(\s|\&nbsp\;||\xc2\xa0)/","其他字符",$str)”语句。

php怎么判断有没有小数点php怎么判断有没有小数点Apr 20, 2022 pm 08:12 PM

php判断有没有小数点的方法:1、使用“strpos(数字字符串,'.')”语法,如果返回小数点在字符串中第一次出现的位置,则有小数点;2、使用“strrpos(数字字符串,'.')”语句,如果返回小数点在字符串中最后一次出现的位置,则有。

php怎么读取字符串后几个字符php怎么读取字符串后几个字符Apr 22, 2022 pm 08:31 PM

在php中,可以使用substr()函数来读取字符串后几个字符,只需要将该函数的第二个参数设置为负值,第三个参数省略即可;语法为“substr(字符串,-n)”,表示读取从字符串结尾处向前数第n个字符开始,直到字符串结尾的全部字符。

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

Repo: How To Revive Teammates
1 months agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: How To Get Giant Seeds
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

Atom editor mac version download

Atom editor mac version download

The most popular open source editor

SAP NetWeaver Server Adapter for Eclipse

SAP NetWeaver Server Adapter for Eclipse

Integrate Eclipse with SAP NetWeaver application server.

MinGW - Minimalist GNU for Windows

MinGW - Minimalist GNU for Windows

This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.