Developer on Alibaba Coud: Build your first app with APIs, SDKs, and tutorials on the Alibaba Cloud. Read more ＞
Use ASP to add a flag advertisement to the WAP mobile page
In my previous article "how to combine WML and ASP technology to compile a dynamic mobile page", I introduced how to use ASP to generate dynamic WML web pages. In this article, I want to further introduce how to use ASP to develop dynamic WML web pages and their applications. In fact, you can use server-side programming (such as ASP) to develop many applications on WAP mobile phones. You only need to generate them directly to generate WAP mobile phones to recognize other WML web pages. For example, we will introduce how to develop a circular flag advertising system for wireless devices such as WAP.
Figure 1 shows a schematic of a flag advertisement, which is a possible way to display a flag advertisement on a WAP site.
By using this method, you can add round-robin flag ads to your website. This gives users who use wireless Internet surfing a chance to learn more about ads, they only need to click the button on the left of the phone to facilitate the user and increase the website revenue.
Suppose we want to create a circular flag advertisement, place it on the top of any page, and use ASP and WML to create this page. In order to make the system more scalable and more realistic, I want to store the advertisement information to be displayed in the database, and then extract all relevant information from the database, so that the generated content remains dynamic. Then, randomly select an advertisement and the link it points to from the database so that the advertisement can appear continuously. Each time a page is loaded, a new advertisement will appear.
Now let me first talk about creating an advertisement database. To simplify the process, I used the Microsoft Access database. The table name is ADbase, with the primary key bannerid (used to indicate the flag advertisement name) and bannertext (displayed on the mobile phone advertisement word, that is, the actual text message of the flag advertisement and bannerURL (link to the advertisement). Of course, you can add some images to the webpage, but to simplify the process, I will save these images. The created database is shown as follows.
<% @ Language = VBScript
'Defines the maximum value used to generate a random number
MaxNoAds = 10
'Set the document type
Response. ContentType = "text/vnd. wap. wml"
'Randomly select an advertisement from the database
Randomize (Cbyte (Left (Right (Time (), 5), 2 )))
AdID = (Int (MaxNoAds-1 + 1) * Rnd + 1 ))
'Retrieve this advertisement from the database
Set objConn = Server. CreateObject ("adodb. connection ")
ObjConn. Open "dsn = adserver; uid = adserver"
SQL = "SELECT * from ADbase where bannerid = '" & AdID &"'"
Set rsAd = objConn. Execute (SQL)
'Display WML content
This article is an English version of an article which is originally in the Chinese language on aliyun.com and is provided for information purposes only. This website makes no representation or warranty of any kind, either expressed or implied, as to the accuracy, completeness ownership or
reliability of the article or any translations thereof. If you have any concerns or complaints relating to the article, please send an email, providing a detailed description of the concern or
complaint, to firstname.lastname@example.org. A staff member will contact you within 5 working days. Once verified, infringing content will be removed immediately.
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:
and provide relevant evidence. A staff member will contact you within 5 working days.