|
Posted by Steve on 02/15/06 21:18
> could use some help with a function to clean up keywords in a url. I'm
> expecting $keywords to equal 'coretta scott king' - the plus signs are
> stripped out for search engine referrals. What am I doing wrong?
> <?php
>
> $referer = 'http://www.google.com/search?hl=en&q=coretta+scott+king';
>
> function parse_keywords($referer){
> // Google, AllTheWeb, MSN, Freeserve, Altavista
> if ((eregi("www.google",$referer)) or
> (eregi("www.alltheweb",$referer)) or (eregi("search.msn",$referer)) or
> (eregi("ifind.freeserve",$referer)) or
> (eregi("altavista.com",$referer))) {
> preg_match("'q=(.*?)(&| )'si", " $url ", $keywords);
> }
.... more code snipped...
> return $keywords;
> }
> $keywords = parse_keywords($referer);
> echo $keywords;
Question 1: what do you think the variable $url contains?
Question 2: why have you got error reporting turned off, which would
answer question 1?
---
Steve
Navigation:
[Reply to this message]
|