View Full Version : passing info from field to SE
05-18-2006, 04:39 PM
Can someone point me to an example of a php script to send a querry to a search engine from a form? I want to have someone enter something into a field, and then send several variations of the text entered with no further input from the user. I also need to be able to display data from each set of results.
Is there a tutorial for this action?
05-21-2006, 09:45 PM
I think passing the text from the textfield to a remote page isnt the hard part. But analyzing and parsing the text from the user actually sounds like a lot of code. What sort of variations of text were you looking for? plurals? speeling corrections? alternate word orders?
This is fairly custom, i dont think youll find a tutorial on it.
05-25-2006, 09:49 AM
naa...sending a few queries, putting the results into a db and then monitoring historical trends on it. It will also have graphic output. It's not going to be a 10 minute project ;)
05-29-2006, 09:38 AM
AJAX is the way to go. The httpRequest object is what you want to look into and experiment with.
The stumbling block for most people though is how to get around the security context of the browser. I've posted a few articles about this in various places - I'm not sure if I mentioned it in this forum somewhere?
Anyway, the way to get around it (so I guess this is something to note for when you get this far in your research) is to use a proxy script on your server. It's very easy indeed, even though it might not seem like it initially.
I could go into more detail, but I'm not 100% sure what your trying to achieve at this point?
Using AJAX though, you can use client (and server) scripting to POST or GET (even PUT) information into remote pages, and retrieve the results in a text stream (responseText). That can include the results pages from any search engine. I've used this for building a keyword tool, and an online rank checker.
However, you need to remember that the search engines don't want you firing automated queries at them. To this end, you could use their API's. I use the Google API (which uses SOAP and XML), Yahoo (it uses REST), and MSN (SOAP and XML). They do (The API's) make the process easier for you and negate the need to do screen scraping. However, they restrict the number of queries you can run in any 24 hour period. Google is the worst at only 100 per day.
So - scraping might well be the way you end up going.
About the proxy script:
Also, you can achieve synchronous, or asynchronous script. The choice is actually yours - and very easily too.
Here's a good starting URL for research:
Have fun. :D
05-29-2006, 11:21 AM
Are you strong w/ ajax?
05-29-2006, 04:02 PM
06-12-2006, 10:05 AM
I thought I was slick enough to hide my spam links in this post, but it looks like I smoked a little too much crack and drank a little too much grain alcohol today.
I'll bet I get a title upgrade in a few seconds...
vBulletin v3.0.3, Copyright ©2000-2013, Jelsoft Enterprises Ltd.