Full-house, Go-Fish, and Blackjack – some of my favorite games to play when I’m with friends. Alright, maybe that’s not true, but they’re definitely a way to pass the time. The words “deck” and “card” are synonymous to playing cards. However, they are also the terms used when developing WAP-enabled websites using WML. In this tutorial, I’ll give a breakdown on just what WAP and WML are and how they can be used. We’ll also run through creating a simple WAP-enabled site making use of multiple cards in a deck. There will be ample code to get you started on developing your own WAP-enabled site, whether for fun or for business.
WML: An Introduction - Would You Like My Special Offer (Page 4 of 6 )
In this next example, I’ll show you how WMLScript can further enhance the interaction between your WAP site and the end-user. We’ll first start by building the form interface that will be presented to the user:
WMLBrowser.go("mailto:firstname.lastname@example.org?from=Special Offer Administrator&subject=Special Offer&body=Thank you for considering our offer. Stay tuned for new offers!");
The prompt_user() function is fairly straightforward. We first make use of the extern keyword to indicate that the function is available to an outside file, in our case example02.wml. We then create our local variables, which will be used to create the user prompt. Our result variable will hold the returned value sent from the user confirmation (a Boolean value).
We then test to see if our result is true. We then test to see if result is true or false. Next, we set the value to our variables (result and email) in the “result” card (see example02.wml), which will be displayed to the user after sending a confirmation email indicating the users selection (yes or no).
The final output displayed to the user is shown below: