21.4. At the Server-side

At the server-side, the name specified by the name attribute of <input> and <select> elements can be used to retrieve the data. You can make use of your favorite server-side technology to do the processing required by your WAP application. Common server-side technologies include ASP, Java Servlet, JSP, Perl, and PHP.

In the earlier XHTML MP example, the form data is sent to the processing.asp file, where some ASP (Active Server Page) code will do the processing. Below is the ASP code in the processing.asp file. It just prints out the form data received at the server. In real WAP applications, the server probably needs to do more complicated processing. For example, storing the form data to a database such as MySQL, PostgreSQL, Microsoft SQL Server, Oracle Database, etc.


<?xml version="1.0"?>
<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN" "http://www.wapforum.org/DTD/xhtml-mobile10.dtd">

<% Response.ContentType = "application/vnd.wap.xhtml+xml" %>

<html xmlns="http://www.w3.org/1999/xhtml">
    <title>XHTML MP Tutorial</title>

      Data received at the server:<br/>
      Username: <% =Request.QueryString("username") %><br/>
      Password: <% =Request.QueryString("password") %><br/>
      Gender: <% =Request.QueryString("gender") %><br/>
      Country: <% =Request.QueryString("country") %><br/>
      Which part of our XHTML MP tutorial do you like?
    for i=1 to Request.QueryString("tutorial_part").Count
      Response.Write(Request.QueryString("tutorial_part")(i) & " ")
      temp_id: <% =Request.QueryString("temp_id") %>

Sony Ericsson T610

Nokia Mobile Browser 4.0

Previous Page Page 36 of 36

Feedback Form (ExpandCollapse)

What do you think about this web page?

(Optional) Please provide us more details. For example, suppose you select option 2 above, can you tell us specifically what information is missing? You can also suggest anything that can help us improve this web page.

(Optional) Your name:

(Optional) Your email address:

Please enter again to confirm:

Due to the amount of messages we received, we may not be able to reply to all messages.

A button for going back to the top of this page