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">
<head>
<title>XHTML
MP Tutorial</title>
</head>
<body>
<p>
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)
& " ")
next
%>
<br/>
temp_id:
<% =Request.QueryString("temp_id")
%>
</p>
</body>
</html>
|
|
Previous Page | Page 36 of 36 |
- 1. XHTML MP (XHTML Mobile Profile) Introduction
- 2. Development of Wireless Markup Languages
- 3. Advantages of XHTML MP
- 4. WML Features Lost in XHTML MP
- 5. Syntax Rules of XHTML MP
- 6. XHTML MP MIME Types and File Extension
- 7. XHTML MP Document Structure
- 8. XHTML MP Generic Metadata
- 9. Comments in XHTML MP
- 10. Line Breaking in XHTML MP
- 11. XHTML MP Horizontal Rules
- 12. XHTML MP Headings
- 13. Font Style in XHTML MP
- 14. XHTML MP Preformatted Text
- 15. XHTML MP Lists
- 16. XHTML MP Images
- 17. XHTML MP Tables
- 18. Anchor Links in XHTML MP
- 19. XHTML MP Selection Lists
- 20. XHTML MP Input Elements
- 21. Submitting Form Data to the Server in XHTML MP