?
Solved

Web Search Page

Posted on 2003-03-30
6
Medium Priority
?
187 Views
Last Modified: 2013-12-24
Hi Guys,

Can some one tell me how I can create a web search page on my website.
I would prefer if I could split off the top 20% of the page to be used for the search options.
And the bottom 80% or so to be used to display the results.
If you know what I mean,

THanks guys.
0
Comment
Question by:pnorris99
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
6 Comments
 
LVL 14

Expert Comment

by:hhammash
ID: 8234698
Hi,

1- Create a new page and save it as SearchWeb.asp
2- Insert a form with one text box and one drop down.
3- Name the textbox as TextSearch
4- Name the Drop Down as Engine
5- The HTML of the form with the textbox and the drop down is as follows:

<p>Search the Web</p>
<form method="POST" action="GoToPage.asp">
<p>
  Search for: <input type="text" name="TextSearch" size="53"></p>
  <p>Select Engine:<select size="1" name="Engine">
  <option selected value="Select">Select</option>
  <option value="Google">Google</option>
  <option value="Alta Vista">Alta Vista</option>
  <option value="Lycos">Lycos</option>
  <option value="Ask Jeeves UK">Ask Jeeves UK</option>
  <option value="Ask Jeeves US">Ask Jeeves US</option>
  <option value="Yahoo">Yahoo</option>
  </select></p>
  <p><input type="submit" value="Search" name="B1"><input type="reset" value="Clear" name="B2"></p>
</form>


6- Save the page.
7- Go under the form and click once
8- Go to Insert/Inline Fame
9- Click once inside it then right click and select inline frame properties.
10- Set the inline frame properties as follows:

Name= ShowResults

Frame Size:
-----------
Width= 748 In Pixles
Height= 2598 in Pixles

Margins:
--------
Width 12 Pixles
Height 16 Pixles

Show Border (uncheck) we do not want the borders

Scrollbars   Select (Never)

Alignment    Select default

11- Click on then Right Click the form  and select Form properties
12- In Target Frame click the button
13- Select ShowResults
14- Click OK then OK again
15- Save the page

Now:
1- Create a new page and save it as GoToPage.asp
2- Switch to HTML View and clear the HTML code leaving the page blank
3- Insert the following Code:


<%
Option Explicit

Dim strChoice, strTextSearch

strChoice=request.form("Engine")
strTextSearch=request.form("TextSearch")

if strChoice="Google" then
          response.redirect "http://www.google.com/search?hl=en&ie=UTF-8&oe=UTF-8&q="+strTextSearch
     elseif strChoice="Yahoo" then
          response.redirect "http://search.yahoo.com/bin/search?p="+strTextSearch
     elseif strChoice="Alta Vista" then
          response.redirect "http://www.altavista.com/web/results?q="+strTextSearch+"&kgs=0&kls=1&avkw=qtrp"
     elseif strchoice="Lycos" then
          response.redirect "http://search.lycos.com/default.asp?lpv=1&loc=searchhp&tab=web&query="+strTextSearch
     elseif strchoice="Ask Jeeves UK" then
          response.redirect "http://www.ask.co.uk/reply.asp?ask="+strTextSearch
     elseif strChoice="Ask Jeeves US" then
          response.redirect "http://www.ask.com/main/askjeeves.asp?ask="+strTextSearch    
end if

%>

4- Save the page
5- Go back to the SearchWeb.asp and right click the form then select properties.
6- Select Send to Other
7- Click Options
8- Type GoToPage.asp in the Action Box
9- Click OK then OK
10- Save the form

Open the form in your browsers,  type your search in the box and then select the engine and click the search button.

Regards
hhammash
0
 
LVL 14

Accepted Solution

by:
hhammash earned 800 total points
ID: 8234754
Hi,

Another suggestion is to use the Select Statement instead of the Elseif:

<%
Select Case strChoice
  Case "Google"
    response.redirect "http://www.google.com/search?hl=en&ie=UTF-8&oe=UTF-8&q="+strTextSearch
  Case "Yahoo"
    response.redirect "http://search.yahoo.com/bin/search?p="+strTextSearch
   Case "Alta Vista"
   response.redirect "http://www.altavista.com/web/results?q="+strTextSearch+"&kgs=0&kls=1&avkw=qtrp"
End Select
%>

Add as more pages as you like.

IMPORTANT NOTE:
---------------
If you want to use engines that are not mentioned here you have to do the following:

1- Go to the engine itself in your browser. e.g, go to www.infoseek.com, then in the search box search for ASP, then look at the URL, you will see this address:

http://go.google.com/hws/search?client=disney-go&cof=AH%3Acenter%3BAWFID%3A7e572b45105f192b%3B&q=asp

Delete the word asp after the = sign and put instead of it
+strTextSearch

so the whole link will look like:
http://go.google.com/hws/search?client=disney-go&cof=AH%3Acenter%3BAWFID%3A7e572b45105f192b%3B&q="+strTextSearch

Copy this and go to your case or elseif statment and put it after the response.redirect,  so it will be like:

elseif strchoice="Infoseek" then
response.redirect "http://go.google.com/hws/search?client=disney-go&cof=AH%3Acenter%3BAWFID%3A7e572b45105f192b%3B&q="+strTextSearch

ALSO: Do not forget to add Infoseek to the drop down box.

NOTE: Do these steps with every engine and remove the asp and replace it with the +strTextSearch.  In some engines the =asp will not come at the end,  you might find it in the middle,  like in Altavista's case. If you find it in the middle you replace it with +strTextSearch+ and put " before and after it.  Look in Altavista's example in my code.

Good luck.

Regards
hhammash


0
 
LVL 1

Author Comment

by:pnorris99
ID: 8237196
Brilliant,
Thanks for that I will try it when I get home.
Thanks again,

Phil,
0
Don't Cry: How Liquid Web is Ensuring Security

WannaCry is just the start. Read how Liquid Web is protecting itself and its customers against new threats.

 
LVL 14

Expert Comment

by:hhammash
ID: 8239061
You are wlecome Phil.
0
 
LVL 1

Author Comment

by:pnorris99
ID: 8240532
Hi there again,
Can you let me me know where the insert / inline frame is in front page, I dont seem to be able to find it.

I tried a few ways of working around this but i couldnt figure it out, kept opening the results in another window, my fault i know.

Thanks again.
0
 
LVL 14

Expert Comment

by:hhammash
ID: 8243657
Hi,

In FrontPage 2002 you go to Insert/Inline Frame


hhammash
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When deciding to adopt any help desk solutions many factors should be explored before taking decisions. This will change from business to another but in general there are some kind of rule of thumb. Here are some quick tips: Do we need only ticket…
When setting up new project requests for our site, one of the most powerful tools our team has available to use is Axure (http://www.axure.com/). It’s a tool for creating software and web prototypes that can function and interact as if it were the a…
The purpose of this video is to demonstrate how to manually back up a WordPress Database. This will be demonstrated using a Windows 8 PC. The Host used will be IPage.com Log into your Hosting account. IPage will be used for demonstration : Locat…
The purpose of this video is to demonstrate how to set up the permalinks on a WordPress Website. This will be demonstrated using a Windows 8 PC. Go to your WordPress login page. This will look like the following: mywebsite.com/wp-login.php : Go t…
Suggested Courses

765 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question