The ASP technology in WAP five

Source: Internet
Author: User

The ASP technology in WAP

Section Fourth: Another way to book your movie tickets

In the previous section, I explained the most basic concepts of WAP and WML, and in this section we'll look at how ASP and WAP are combined.

Now in Oslo, cinemas provide a telephone system based on the sale of tickets, the system is very complex, and must give users some instructions to guide users to buy tickets, and users must find in the newspaper some kind of movie code, this is annoying, we introduce another method.

Here, this will show you a simple WAP application that allows mobile subscribers to book tickets: a service that is sure to be applauded. Users do not have to remember the annoying code, they can choose movies and cinemas directly from the menu, and users do not need authentication. In this example, users are required to pay 40 minutes before the movie starts, but in real life, users can also pay by phone.

This application imagines that a movie can be shown at multiple cinemas at the same time, and that a movie theater is staged at different times.

Here I do not think too much about the problem of error handling, because this is not the focus of this chapter, you like you can add yourself.

For simplicity, I used access 97来 as a database, and of course the real system won't use it, and other databases like SQL Server don't have to change much code.

Database diagrams

Database diagrams

. Movie and theater tables are clearly needed. The show table is used to track how many vacancies are still available for sale.

How to debug this program

In order to access this WAP service, you need a WAP emulator, which is mainly debugged on Nokia Toolkit 1.2, please check the previous section for details.

Choose a movie

Select a movie in the list list:

Here is the code:

<!--#include file= "conn.asp"--><% ' send the right MIME type

Response.ContentType = "TEXT/VND.WAP.WML"

The first thing to do is to declare WML, how the emulator doesn't declare XML in the right place, it doesn't accept WML although Nokia 7110 can ignore that, but it doesn't guarantee that other phones will do, so you have to do it. Also you have to set the MIME type well.

< XML version= "1.0"? >

<! DOCTYPE WML public "-//wapforum//dtd WML 1.1//en" "http://www.wapforum.org/DTD/wml_1.1.xml" >

< WML >

Before entering the next card there will be a flashing screen to display a picture wbmp a new format. This event is determined by the timer attribute, where we set the time to 5 seconds. The OnTimer event will take you to another card after it is raised. (WMBP's Photoshop plugin can be downloaded free from the Internet).

< card id= "Splash" ontimer= "#card1" title= "Welcome to" > < timer value= "M"/>

< p align= "center" >

< br/>

< img src= "pix/logo.wbmp" alt= "WAP Movies"/>

</p >

</card >

< card id= "Card1" title= "Choose a film" >

<%

sqlquery = "SELECT [movie_id], [title] from Movie"

Set rsmovies = conn. Execute (SQLQuery)

:

% >

< p >

< select Name= ' movie ' >

<%

Do as not rsmovies.eof

Response.Write ("< option value= '" & Rsmovies ("movie_id") & ">" & Rsmovies ("title") & "</option > "& vbCrLf)

Rsmovies.movenext

Loop% >

</select >

This section is the focus of this article. Reading the required data from the database shows that as an ASP programmer, this is nothing special, but this simple program is now used for a new server. This also makes me think more about the network programming ASP in the WML commercial station than the Java servlet.

< small > < anchor title= "next!" >next

< go href= "step2.asp" method= "Get" >

< Postfield name= "movie" Value= "$ (movie)"/>

</go >

</anchor >

</small >

</p >

The submission of forms can also be done through soft switching functions (do and anchor). Here, I do this through a simple inline link, because I think it can make the user feel intuitive and friendly. Postfields is about the same as the hidden in HTML, but the WML variable does not need to be routed in JavaScript as it does in HTML, it can be written directly in WML, as explained in the previous section. The way to pass here is get, The Post method is also supported by the WAP specification, and the emulator can recognize it, but unfortunately, in Nokia 7110, this post is not supported, so you have no choice.



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.