After working with computers for so many years, this is the first time I write an article online!
Purpose of the program:For
work needs, there are too many friends who inquire about company registration information. To save trouble, a query function has been added to the website. Some people actually said that if you don’t have a computer, you should have a mobile phone if you don’t have a computer. You can use your mobile phone to query anytime and anywhere. Just do it and make a WAP query, all written in Notepad.
The database structure is as follows:
Library name: data.mdb
Table name: info
field: id, company name, residence, legal representative... (This ellipsis means etc.)
1.
The source code of the feedback page hello.asp is as follows:
<%@ Language=VBScript%>
<% Response.ContentType="text/vnd.wap.wml" %>
<?xml version="1.0" encoding="gb2312"?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" " http://www.wapforum.org/DTD/ wml_1.1 .xml">
<wml>
<card id="qycx" title="Shangrao Industrial and Commercial Information Network">
<p>
Please enter query information<input name="qycx" type="text" maxlength="16" />
<anchor title="OK">OK
<go href="qycx.asp" method="post">
<postfield name="qycx" value="$qycx"/>
</go>
</anchor>
<br/><br/>
Shangrao Industrial and Commercial Information Network
</p>
</card>
</wml>
2.
The source code of the information receiving page qycx.asp is as follows:
<%@ Language=VBScript %>
<% Response.ContentType = "text/vnd.wap.wml" %>
<?xml version="1.0" encoding="gb2312"?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" " http://www.wapforum.org/DTD/ wml_1.1.xml">
<wml>
<card id="qycx2" title="Shangrao Industrial and Commercial Information Network">
<p>
<%
qycx=request.FORM("qycx")
cx="Company name like '%"&qycx&"%' "
Set conn=Server.CreateObject("adodb.connection")
'conn.Open "dsn=qycxsjk;uid=;pwd=;database=data.mdb"
conn.open "driver={microsoft access driver (*.mdb)};dbq="&server.mappath("qycx.mdb")
sql="select * from info where "&cx&""
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
do while not rs.eof
%>
<%qymc=rs("Company name")
id=rs("id")
%>
<a href="qycx2.asp?id=<%Response.write id%>" ><%Response.write qymc%></a>
<br/>
<%
rs.movenext
loop
rs.close
%>
<br/><br/>
Shangrao Industrial and Commercial Information Network
</p>
</card>
</wml>
<% Function uni(Chinese)
For i = 1 to Len (Chinese)
a=Mid(Chinese, i, 1)
uni=uni & "&#x" & Hex(Ascw(a)) & ";"
next
End Function
%>
=================================================
Second comment: I was a little sweaty when I saw this. I first used "company name" as the keyword to submit, but later I thought of using ID as the keyword to avoid the problem of submitting Chinese characters. I actually thought about such a basic question for a long time. Here, based on the "Company Name" keyword query submitted by hello.asp, we get the full names of all companies that contain this keyword in the "Company Name" field (to avoid duplication), make a list, and click to enter the third page, which is the details of the company. material.
3.
The source code of qycx2.asp is as follows:
<%@ Language=VBScript %>
<% Response.ContentType = "text/vnd.wap.wml" %>
<?xml version="1.0" encoding="gb2312"?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" " http://www.wapforum.org/DTD/ wml_1.1.xml">
<%
Set conn=Server.CreateObject("adodb.connection")
'conn.Open "dsn=qycxsjk;uid=;pwd=;database=data.mdb"
conn.open "driver={microsoft access driver (*.mdb)};dbq="&server.mappath("qycx.mdb")
%>
<wml>
<card id="qycx3" title="Shangrao Industrial and Commercial Information Network">
<p>
<%
name=request.querystring("id")
sql="select * from info where id="&name&""
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
do while not rs.eof
%>
<%qymc=rs("Company Name")%>
Company name: <%Response.write qymc%>
<br/>
<%zs=rs("residence")%>
Residence:<%Response.write zs%>
<br/>
<%fddb=rs("Legal Representative")%>
Legal representative:<%Response.write fddb%>
<br/>
<%zczb=rs("Registered Capital")%>
Registered capital:<%
if left(zczb,1)="." then
Response.write "0"
else
end if
Response.write zczb%>10,000 yuan
<br/>
<%qylx=rs("Enterprise Type")%>
Enterprise type:<%Response.write qylx%>
<br/>
<%jyfw=rs("Business Scope")%>
Business scope:<%Response.write jyfw%>
<br/>
<%zcrq=rs("Establishment date")%>
Registration date:<%Response.write zcrq%>
<br/>
<%
rs.movenext
loop
%>
<br/><br/>
Shangrao Industrial and Commercial Information Network-End
<br/>
<a href="hello.asp">Return</a>
</p>
</card>
</wml>
=====================
OK, complete the query and display company details!
If my writing is not good, don’t scold me. Hehe, friends who like WAP are welcome to communicate with me and give me some guidance! QQ:18185813