How to fix Fatal error: Call to a member function find() on a non-object Error?

Discussion in 'PHP' started by shrinath, May 8, 2011.

  1. #1
    I run a MP3 search engine site and I use beemp3 recent search list on my site footer.
    It works for few hours and after sometime I get this error.

    Fatal error: Call to a member function find() on a non-object in /home/xxxxx/public_html/xxxx/xxxx/includes/functions.php on line 177

    I have this on on line 177

    
    function beemp3200($limit) {
    	                $html = @file_get_html('http://beemp3.com/');
    	                $last200area = $html->find('div[class="last200"]', 0);
    line177-->   	$last200 = $last200area->find('a');
    
    	if (!isset($limit)) {
    		$limit = $settings['recentlimit'];
    	}
    
    	$count = 0;
    	foreach ($last200 as $onesearch) {
    		$onesearch = expstr($onesearch, '>', '<');
    		$onesearch2 = seoit($onesearch);
    		echo '<a href="'.WEB_PATH.'search/mp3/1/'.$onesearch2.'.html" title="'.preg_replace("/[^a-zA-Z0-9\s]/", "", $onesearch).' free mp3 download">'.$onesearch.'</a>';
    		$count++;
    		if ($count >= $limit) { break; }  else { echo ' - ';}
    	}
    }
    
    
    Code (markup):
    what could be the wrong?
    please help..:(
     
    Last edited: May 8, 2011
    shrinath, May 8, 2011 IP
  2. lucyfrances

    lucyfrances Greenhorn

    Messages:
    32
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    16
    #2
    you can look print_r($html); . if $html have find , there is no error.but ı think $have havent got find
     
    lucyfrances, May 8, 2011 IP