You are here: Re: function problems « PHP Programming Language « IT news, forums, messages
Re: function problems

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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация