Write dynamic mobile page using WML and ASP

zhaozj2021-02-16  82

ASP

versus

WAP

Combined with rich dynamics

WML

Page, you can give

WAP

The phone brings a lot of interesting content. So how do you make both organic combinations to generate a dynamic web page? In this article, I want to introduce how to use it.

ASP

Develop a dynamic generation

WML

s application. For example, the e-banking of the mobile phone is now fired, so how do we build such an app? Here I don't want to discuss the establishment of the entire e-banking, because the content is too large, beyond the scope I can introduce, here I just want to introduce, how to use

ASP

Establish an app to check the user's balance of payment balance. Considering its security, we have to use

WTLS

However, this problem is more complicated, and only the opportunity will be discussed again. We have to put your energy in how to use

ASP

To realize the dynamic webpage.

Said so much nonsense, let's get started! Suppose the bank account information is saved

SQL

In the database, if you use the appropriate network connection, you can enter our system. In the example of this article, in order to simplify us to make the account information very small (in fact is not this): only account number; customer name, security password, account balance balance, in a table (

TBL_ACCOUNT_INFO

), There are four domains corresponding to

Accountno, Custname, Accountpin

with

Accountbal

.

Below, I want to talk about programming ideas: First, users enter our system interface, enter their account and security password (as shown

1

After verifying these login information, we allow users to log in to enter the system, we will give a welcome language and output the balance of payments on the username and account!

Figure 1

This is the general development idea, well, now we can program it according to this idea. I have a habit. When I write a dynamic program code, I first write the static code, and then try to write the dynamic code. This method will also be used in this article.

First, at the first part of the code, we will create a page to use to receive login information. (As shown)

1

)

Please pay attention to the following code, these code is the most basic

WML

Code:

<

% Response.contentType = "text / vnd.wap.wml"%

>

<

XML Version = "1.0" encoding = "GB2312"?

>

//

Pay attention to this sentence, if you want to display Chinese, you must join

Encoding = "GB2312"

<

! DOCTYPE WML PUBLIC "- // WAPFORUM / / DTD WML 1.1 // En" "http://www.wapforum.org/dtd/wml_1.1.xml"

>

<

WML

>

<

Card id = "Login" Title = "WAP

Internet banking

"

>

<

p

>

Welcome to

WAP

Internet banking

<

BR /

>

please enter account

:

<

Input name = "accountno" type = "text" maxlength = "6" />

Security Code

:

<

Input name = "accountpin" type = "password" maxlength = "4" /

>

<

Do Type = "accept" label = "check bal"

>

<

Go href = "checkbal.asp" method = "post"

>

<

Postfield name = "accountno" value = "$ accountno" /

>

<

Postfield Name = "Accountpin" value = "$ accountpin" /

>

<

/ Go

>

<

/ do

>

<

/ P

>

<

/ card

>

After receiving the user login information page, we must verify that the information fill the information is illegal. If the account is not full, the security password is not filled, these steps are generally carried out in the client, thus The process of processing the wireless communication coupled to minimize to mitigate communication interruptions caused by communication congestion. Because the mobile phone is different from ordinary

PC

Machine, its bandwidth is relatively small, slow connection.

Ok, the next step we have to truly join the database, we have to make a standard

SQL

Request a statement, and then the server will return a recordset, and our record set extract the information we need, and then display it in the corresponding domain in the next page. These are dynamic content: obtain request information from the user, then show them the dynamic information they want to get, so they do

"

Mobile phone information Personalization

"

. Please see the code:

<

Card id = "Login" Title = "WAP

Internet banking

"

>

<

p

>

<

% txtsql = "select * from tbl_account_info where accountno = '" Request.form ("Accountno") & "' and accountpin = '" Request.form ("Accountpin") & "'" SET RS = Conn.execute (txtsql) IF f. "invalid login" response.write "

<

Do Type = 'accept' label = 'retry'

>

"Response.write"

<

Go href = 'index.asp' /

>

"Response.write"

<

/ do

>

"Else Response.write"

Hello

, "& rs.fields (" CustName ") &"

Mr

"

<

BR /

>

"Response.write"

Your balance is ¥

"& rs.fields (" Accountbal ")%

>

After getting back information from the server, we display this information: as shown

2

Ok, a simple e-banking query system is written. From the above example we can see in the design

WAP

Pay attention to the following questions when pages:

1

To keep the content, short care. We must make simple and able to meet their requests quickly and can quickly meet their requests!

2

,use

ASP

Ability to complete the preparation

WML

Page, it

ASP

The prepared ordinary page is basically try, only some subtle changes, such as joining

WML

The tag of page recognition. You can also try to write some other dynamic content.

转载请注明原文地址:https://www.9cbs.com/read-13538.html

New Post(0)