Solved

How can I retrieve information from a search engine in order to display relative info on a page

Posted on 2003-12-05
3
200 Views
Last Modified: 2006-11-17
I am trying to create a dynamic text block that would change depending on what search values a user entered to surf to our site.  How can I retrieve that info from the search engine?
0
Comment
Question by:scavdog
3 Comments
 
LVL 6

Accepted Solution

by:
aolXFT earned 125 total points
ID: 9884492
you need to be _WAY_ more specific. That would be pretty advanced stuff, and no matter what you do, it may work, it may not.

To get the terms entered into a search engine will vary depending on the search enginge. You may be able to get variables passed by the get method, parsing $_SERVER['HTTP_REFERER']. You won't be able to get variables passed by the Post method however.

for Google this _may_ work

$match = array();
preg_match("#q=(.*?)&#", $_SERVER['HTTP_REFERER'], $match);
$search = $match[0];
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Website Interactive tool that will do calculations 3 52
.htaccess 5 33
str_replace not working in php script 4 25
Why do people dis php? 5 46
Generating table dynamically is the most common issue faced by php developers.... So it seems there is a need of an article that explains the basic concept of generating tables dynamically. It just requires a basic knowledge of html and little maths…
Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

813 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

15 Experts available now in Live!

Get 1:1 Help Now