Manually type a search string in browser? - Posted (2433 Views)
Junior Member
Lon2
Posts: 151
151
I searched Snitz and couldn't find a topic on this: I was wondering if it's possible to type a search string directly in my browser's address field to search the forums without using the forum's search form? For example, typing this directly in the browser's address bar:

http://www.website.com/forum/search.asp?forum_ID=4&SearchTerms=word1,word2<
 Sort direction, for dates DESC means newest first  
 Page size 
Posted
Senior Member
MaD2ko0l
Posts: 1053
1053
i dont think you add search terms..if i remember correctly its to stop a security flaw..correct me if im wrong that may have been for somthing else but im sure they made it this way so that a user cannot exploit anything that may occur via dodgy search terms.<
© 1999-2010 MaD2ko0l
Posted
Forum Admin
HuwR
Posts: 20611
20611
it has always been a POST form rather than a GET, I don't know why it was done the way it was, it has allways been that way.<
Posted
Junior Member
Lon2
Posts: 151
151
Thanks for the answers.
<
Posted
Senior Member
leatherlips
Posts: 1838
1838
You can in Google.
For example, in Google's search field type:

Code:
your search terms here site:www.yoursite.com/forum
Google will only search for that term within the URL you specified.
So if I wanted to search for the word concert in my forum I would type:

concert site:www.mangionemagic.com/forum

Here is what the results would show up as in Google.
<
Posted
Advanced Member
Etymon
Posts: 2396
2396
Find the line in search.asp that has:

if Request.QueryString("mode") = "DoIt" then

Above that add this:

Code:
if trim(Request.Form("Search")) <> "" then
ThisSearch = Request.Form("Search")
elseif trim(Request.QueryString("Search")) <> "" then
ThisSearch = Request.QueryString("Search")
end if

Change:

if Request.QueryString("mode") = "DoIt" then

To:

if Request.QueryString("mode") = "DoIt" or ThisSearch <> "" then

And, change all instances of:

Request.Form("Search")

To:

ThisSearch

Try your search for one word as:

http://www.mydomain.com/search.asp?search=word1

Try your search for two words as:

http://www.mydomain.com/search.asp?search=word1+word2

Most of all ... have fun! smile<
Posted
Forum Admin
HuwR
Posts: 20611
20611
Try your search for two words as:

http://www.mydomain.com/search.asp?search=word1+word2

Most of all ... have fun!
it would work, but would not actually do what Lon2 asked which was to search a particular forum smile<
Posted
Advanced Member
Etymon
Posts: 2396
2396
In addition to what I wrote above ...
Below the following:

Code:
if trim(Request.Form("Search")) <> "" then
ThisSearch = Request.Form("Search")
elseif trim(Request.QueryString("Search")) <> "" then
ThisSearch = Request.QueryString("Search")
end if


Add this:

Code:

if trim(Request.Form("Forum")) <> "" then
ThisForum = Request.Form("Forum")
elseif trim(Request.QueryString("Forum")) <> "" then
ThisForum = Request.QueryString("Forum")
end if


And, change all instances of:

Request.Form("Forum")

To:

ThisForum

Try your search for one word as:

http://www.mydomain.com/search.asp?search=word1&forum=1

Try your search for two words as:

http://www.mydomain.com/search.asp?search=word1+word2&forum=1

if the forum id you are querying does not produce results, then try the next forum id.
Above of all ... have much more fun than you were having before! bigsmile <
Posted
Advanced Member
Etymon
Posts: 2396
2396
Hey Huw,

If you think this qualifies as a MOD, then after Lon2 gets to have a look at it, would you mind moving the topic over to the MOD Add-on Forum w/Code for others to enjoy as well?
Cheers,

Etymon<
Posted
Support Moderator
Podge
Posts: 3776
3776
The ideal thing would be to store the search terms in a string variable (e.g. searchterms) and replace all the Request.Form instances with that variable.
<
Posted
Advanced Member
Etymon
Posts: 2396
2396
Isn't that what I did here: smile
Code:
if trim(Request.Form("Search")) <> "" then
ThisSearch = Request.Form("Search")
elseif trim(Request.QueryString("Search")) <> "" then
ThisSearch = Request.QueryString("Search")
end if
<
You Must enter a message