|
-
Jul 18th, 2001, 08:55 AM
#1
Thread Starter
Hyperactive Member
Early Stages Of Search Engine
Hi
My Code
<!-- #include file="connect.inc" -->
<!-- this file enables to RecordCount to correctly function -- >
<!--#include file="adovbs.inc"-->
<%
Session("Query") = Request.QueryString("query")
Call Header
Dim objConn
Dim objRec
Set objConn = Server.CreateObject ("ADODB.Connection")
Set objRec = Server.CreateObject ("ADODB.Recordset")
objConn.Open gsConnect
objRec.Open "webdata", objConn, adOpenStatic
objRec.MoveFirst
While Not objRec.EOF
'Response.Write objRec("id") & "<BR>"
objRec.MoveNext
Wend
'Response.Write "<b>Number = " & (objRec.RecordCount)
objRec.Close
objConn.Close
Set objRec = Nothing
Set objConn = Nothing
Sub Header
%>
<HTML>
<HEAD>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<meta http-equiv="Content-Language" content="en-us">
<TITLE>Search</TITLE>
</HEAD>
<body bgcolor="#FFFFFF" >
<Font Face="Arial" Size="2">
<table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td width="100%" colspan="2"></td>
</tr>
<tr>
<td width="50%" bgcolor="#000000">
<Form method="Get" id=form1 name=form1>
<table border="0" width="100%">
<tr>
<td width="33%" align="right"><font color="#FFFFFF" size="2" face="Tahoma,Arial"><b>Search for </b></font></td>
<td width="33%"><input type="text" size="20" value="<%=Request.QueryString("query")%>" name="query"></td>
<td width="34%"><input type="submit" name="Search" Value="Search"></td>
</tr>
</table>
</Form>
</td>
<td width="50%" bgcolor="#000000"></td>
</tr>
<tr>
<td width="100%" colspan="2" bgcolor="#000000"></td>
</tr>
</table>
<%
End Sub
If Trim(Session("Query")) <> "" Then
Search Request.QueryString ("query")
else
Response.Write "<b>Field empty</b>"
end if
Sub Search (searchstring)
if searchstring = "Gary" then
Response.Write "<b>whoopee</b>"
end if
End Sub
%>
</BODY>
</HTML>
Anyone tell me why Request.QueryString ("query") doesn't carry a value???
Gary
"Life isn't about finding yourself. Life is about creating yourself."
--George Bernard Shaw
-
Jul 18th, 2001, 09:20 AM
#2
Black Cat
In the url, http://www.whatever.com/page.asp?query=somequery , Request.QueryString("query") would be "somequery". To get a named value from a form, use Request.Form("query"), as it looks like you're using in your code.
Josh
Get these: Mozilla Opera OpenBSD
I have books for sale: "MCSD in a Nutshell" and "VB Distributed Exam Cram" - PM me for details. Will also trade for a decent ATX Pentium 2 MB/CPU/RAM combo.
-
Jul 18th, 2001, 09:28 AM
#3
Thread Starter
Hyperactive Member
Hi
Getting nothing back from this....
Search Request.Form("query")
Response.Write "<b>" & Request.Form("query") & "</b>"
Sub Search (searchstring)
if Request.Form("query") = "Gary" then
Response.Write "<b>whoopee</b>"
end if
End Sub
"Life isn't about finding yourself. Life is about creating yourself."
--George Bernard Shaw
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|