|
-
Jun 21st, 2001, 06:31 AM
#1
-
Jun 21st, 2001, 06:46 AM
#2
Hyperactive Member
are you searching a database or a text file?
ASP, PHP, VB, JavaScript, CSS, HTML, a little C and a little CGI.
Richard Whitehouse.
Join the Footie Predictions League
"Make it idiot proof and someone will make a better idiot."
-
Jun 21st, 2001, 06:49 AM
#3
a database. i know how to do the code to connect to it and all that crap, i just dunno how to react to the button being clicked and displaying the results on a new page.
-
Jun 21st, 2001, 06:55 AM
#4
Hyperactive Member
I just post the form to a new page by doing the following
<form name="form1" method="post" action="newpage.asp">
and then in newpage.asp
Code:
<HTML>
<HEAD></HEAD>
<BODY>
<%
// request the form data
searchtext=request.form("nameoftextbox")
//connect to the database, which you said you can do
//build my sql string
thesql="SELECT * FROM mytable WHERE whatiwanttosearch LIKE '%" & searchtext & "%'"
Set Rs=oConn.Execute(thesql)
//only do the following if a match has been found
if not rs.eof or not rs.bof then
rs.movefirst
do
//write out as to which record has been found
rs.movenext
loop until rs.eof
end if
%>
</BODY>
</HTML>
hope this makes sense and that everything works. any more queries don't hesitate to ask.
ASP, PHP, VB, JavaScript, CSS, HTML, a little C and a little CGI.
Richard Whitehouse.
Join the Footie Predictions League
"Make it idiot proof and someone will make a better idiot."
-
Jun 21st, 2001, 07:03 AM
#5
thanks, that looks like what im after. however, im still a bit confused about this:
<form name="form1" method="post" action="newpage.asp">
shouldn't that be for a button instead, like:
<INPUT type=button value=Search name="button1" action="page1.asp">
-
Jun 21st, 2001, 07:06 AM
#6
Hyperactive Member
sorry, i missed out the button, but i always do the following
Code:
<form name="form1" method="post" action="newpage.asp">
<input type="submit" name="Submit" value="Submit">
</form>
This will submit the form to the page when the user clicks on the button
ASP, PHP, VB, JavaScript, CSS, HTML, a little C and a little CGI.
Richard Whitehouse.
Join the Footie Predictions League
"Make it idiot proof and someone will make a better idiot."
-
Jun 21st, 2001, 07:10 AM
#7
excellent, that's what i need, thanks
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
|