Solved

to search (in a way)

Posted on 1999-01-28
9
169 Views
Last Modified: 2013-12-25
i want to make it so that i can enter a word into a
text box and then hit a button "search" and then that
will go to a given search engine (say yahoo.com) and
it will give me the relevant results

so its just like searching directly on the search engine
but doing it from my page...

thanks
paddy
0
Comment
Question by:paddytsr
  • 6
  • 3
9 Comments
 
LVL 7

Expert Comment

by:jconde
ID: 1832439
Hi, that's pretty simple.....if there's only one search engine you will be using....what you need to do, is to call yahoos search cgi, and send the correct parameters.

I.e (THis goes in your html template)
<FORM ACTION="http://search.yahoo.com/bin/search">
<INPUT TYPE="TEXT" NAME="p">
<INPUT TYPE="SUBMIT" VALUE="SEARCH">
</FORM>

If you want to have multiple search engines that one can choose from, you will need to do the same, but with a CGI that will redirect to the selected search engine with it's parameters.

Regards,

Jorge
0
 

Author Comment

by:paddytsr
ID: 1832440
thanks,
theres just one more thing that id like to know if its possible to do...

when i search www.yahoo.de (the german yahoo) for a word say "test" i get a lot of links and some sentences beside some links with a sentence containing the word "text"

Is it possible to just get a list of these sentences with the word searched for when u hit search for the word?

Thanks
Paddy
0
 

Author Comment

by:paddytsr
ID: 1832441
Adjusted points to 55
0
 

Author Comment

by:paddytsr
ID: 1832442
and also how exactly do you do it for multiple search engines.....
0
What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 
LVL 7

Accepted Solution

by:
jconde earned 60 total points
ID: 1832443
What do you mean by a List of sentences that contain the searched word???.....do you mean, in order for you to display the results with your own html format?

To search multiple search engines it's quite tricky!

I will give you the algorithm of what you need:

1) Receive the search string and the search engine that will be used
2) Open a socket to the search engine
3) Send the path and parameters to the search engines httpd
4) While (Not end of socket stream)
5) Print the contents of the socket stream
6) Close the socket.

If you do this, since you have complete control over the html before it's printed out on the browser, you can format the html to your convenience.

P.S.  No need to reject my answer, I would have still helped you all the way through.
0
 

Author Comment

by:paddytsr
ID: 1832444
Yeah, i want to display the results with my own html format... in a way just "real life" examples of how the word appears in
various sentences...

can you be any more precise on the algorithm for multiple search
engines, i'm new to all this and dont have a clue how to go about writing the code....

sorry about the rejected answer, im new to this site too
thanks
paddy
0
 
LVL 7

Expert Comment

by:jconde
ID: 1832445
What httpd are you using??...

I have some samples that do pretty much what you're looking for but they're written with php3.....will it work for you?
0
 

Author Comment

by:paddytsr
ID: 1832446
what is php3?
paddy

0
 

Author Comment

by:paddytsr
ID: 1832447
i am using an apache server on unix...
and im new to it, i only know the basics
paddy
0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Making a simple AJAX shopping cart Couple years ago I made my first shopping cart, I used iframe and JavaScript, it was very good at that time, there were no sessions or AJAX, I used cookies on clients machine. Today we have more advanced techno…
It is a general practice to get rid of old user profiles on a computer  in a LAN environment. As I have been working with a company in a LAN environment where users move from one place to some other place at times. This will make many user profil…
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

744 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now