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
210 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
migrating to phpbb forum from vBulletin 4.2 3 97
Bootstrap - BootBox - PHP - MYSQL - Response Trigger 6 62
Joomla Editing 3 23
php time 12 29
These days socially coordinated efforts have turned into a critical requirement for enterprises.
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…
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 dynamically set the form action using jQuery.

759 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