Practical ASP-practical ASP (5)

Source: Internet
Author: User
Tags access database microsoft access database
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
%>
Related Article

E-Commerce Solutions

Leverage the same tools powering the Alibaba Ecosystem

Learn more >

Apsara Conference 2019

The Rise of Data Intelligence, September 25th - 27th, Hangzhou, China

Learn more >

Alibaba Cloud Free Trial

Learn and experience the power of Alibaba Cloud with a free trial worth $300-1200 USD

Learn more >

Contact Us

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: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.