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 (Expand)

What do you think about this web page?

XHTML MP Tutorial - Table of Contents XHTML MP Tutorial - Contents at a Glance Preferences - Light mode / Dark mode Preferences - Do Not Show Ads Previous Page