日期:2014-05-17 浏览次数:20994 次
<script language=javascript>
<!--
function CheckForm()
{
if(document.form1.cpkey.value=="")
{
alert("请输入你要查询的关键词!");
document.form1.cpkey.focus();
return false;
}
}
//-->
</script>
<form name="form1" method="post" action="search.asp" onSubmit="return CheckForm();">
<table width="190" height="60" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="70">输入关键字</td>
<td><input name="name" type="text" id="name" size="15"></td>
</tr>
<tr align="center" valign="middle">
<td colspan="2"><input type="submit" name="Submit" value="点击搜索"></td>
</tr>
</table></form>
<!-- #include file="Inc/Conn.asp" -->
<!-- #include file="Head.asp" -->
<%
cpkey=request.form("name") '获取关键词
sqlpic="select * from Photo where cpkey='"&name&"'"
set rspic=server.createobject("adodb.recordset")
rspic.open sqlpic,conn,1,1
%>
<table width=668 border=0 align="center" cellpadding=0 cellspacing=0 style="margin-top:5px;">
<tr>
<td align=left valign="top">
<%
do while not rspic.eof
%>
<table width="150" height="22" border="0" align="left" cellpadding="0" cellspacing="0">
<tr>
<td width="130" height="20" align="center" valign="middle" bgcolor="#FFFFFF"><a href="View.asp?id=<%=rs("id")%>"><%=Left(rs("name"), 22)%></a></td>
</tr>
</table>
<%
rspic.MoveNext
Loop
%> </tr>
</table>
//document.form1.cpkey.focus();
document.form1.name.focus();