#13 fetch_person.php not work

open
nobody
None
5
2012-02-17
2012-02-17
Marko Schulz
No

If I want to change the author of the film 'The Silence of the Lambs,' and I enter 'Jodie Foster' then I get the following error message:

Notice: Undefined offset: 1 in /var/www/htdocs/php/filmdb/imdb/fetch_person.php on line 46

Apparently, the search expression

preg_match("#Location: /search/name\?count=&name=(.+?)&view=simple#i", $site, $x);

found nothing, and therefore $x is not bound.

If I go to http://www.imdb.com/search/name?name=Jodie%20Foster&view=simple then I get the right result.

How can I fix this?

Version: 1.2.4 (08-Sep-2010)

Discussion