Link to home
Start Free TrialLog in
Avatar of pnorris99
pnorris99Flag for Australia

asked on

Web Search Page

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.
Avatar of hhammash
hhammash

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
ASKER CERTIFIED SOLUTION
Avatar of hhammash
hhammash

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of pnorris99

ASKER

Brilliant,
Thanks for that I will try it when I get home.
Thanks again,

Phil,
You are wlecome Phil.
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.
Hi,

In FrontPage 2002 you go to Insert/Inline Frame


hhammash