想做一个像车票查询一样的系统,研究了半天,变量这一关就过不了(入门学习级菜鸟),哪位好心人教教我该怎么做?
access里表为:
ID 站点 里程 A B C ...
1 北京 1000 12 13 14 ...
HTML页里源码如下:
<form name="form1" id="form1" method="post" action="xxx.asp">
<p>
<select name="cx">
<option value="选择" selected="selected">选择</option>
<option value="A">A</option>
</select>
</p>
<p>
<select name="zd">
<option value="选择" selected="selected">选择</option>
<option value="北京">北京</option>
</select>
</p>
<p>
<input type="submit" name="chaxun" value="查询" />
</p>
</form>
xxx.asp源码为:
<% @LANGUAGE = VBScript %>
<%
Option Explicit
Response.Expires = 0
Dim xing,zhan,conn,Strcon,StrSQL,rs
xing=request.form("cx")
zhan=request.form("zd")
Set conn=server.createobject("adodb.connection")
Strcon="driver={microsoft access driver (*.mdb)};dbq="&server.mappath("xxx.mdb")
conn.open Strcon
StrSQL="select 'xing' from 收费查询 where 站点='zhan'"
Set rs= conn.Execute(StrSQL)
%>
<html><head>
<title>无标题文档</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<body>
<%
do while not rs.eof
Response.Write rs("xing")
rs.movenext
loop
conn.close
Set rs=Nothing:Set conn=Nothing
%></body>
</html>
提交后,数据显示不出来。请问大虾是哪儿的错误?另外,如果想把它们放在一个文件里,那提交action=""应该填什么?