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
191 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

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Suggested Solutions

Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
This article discusses how to create an extensible mechanism for linked drop downs.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

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

16 Experts available now in Live!

Get 1:1 Help Now