Jump to content


Variable recognized by IDE but on the server.

unrecognised variable echo loop

  • Please log in to reply
1 reply to this topic

#1 the5thace

  • Members
  • PipPip
  • Member
  • 26 posts

Posted 28 July 2013 - 06:53 PM

Notice: Undefined variable: bing_results in /home/msc2012/12254822/public_html/safe_dir/Almost_Gs.php on line 295


Basically, its the 'Interleaving' case that does not work as the echoed variables are not recognized when run on the server but the IDE does not highlight them as errors so it recognizes them.


If you pay attention further down the switch statement under other cases I use the same variable $bing_results where it works and is recognized by the server.


The scenario is the same with $Blekko and $Google

    case 'Interleaving':
        $irl =0;
        while($irl <= 90)
            echo 'hellooo!!';
            echo '<a href ='.$bing_results[$irl]['url'].'><h5>'.$bing_results[$irl]['url_title'].'</h5></a><br>';
            echo '<p>'.$bing_results[$irl]['snippet'].'</p><br>';
            echo '<p>'.$bing_results[$irl]['rank'].'<p><br>';
            echo '<b>'.$bing_results[$irl]['engine'].'</b><br>';
            echo '<hr>';    
            echo '<a href ='.$Blekko[$irl]['url'].'><h5>'.$Blekko[$irl]['url_title'].'</h5></a><br>';
            echo '<p>'.$Blekko[$irl]['snippet'].'</p><br>';
            echo '<p>'.$Blekko[$irl]['rank'].'<p><br>';
            echo '<b>'.$Blekko[$irl]['engine'].'</b><br>';
            echo '<hr>';
            echo '<a href ='.$google[$irl]['url'].'><h5>'.$google[$irl]['url_title'].'</h5></a><br>';
            echo '<p>'.$google[$irl]['snippet'].'</p><br>';
            echo '<p>'.$google[$irl]['rank'].'<p><br>';
            echo '<b>'.$google[$irl]['engine'].'</b><br>';
            echo '<hr>';
    case 'Non-Aggregated':
    $nag_c=0;    // non aggregated count 
    while ($nag_c <=$blekko_count)
        echo '<a href='.$Blekko[$nag_c]['url'].'><h4>'.$Blekko[$nag_c]['url_title'].'</h4></a>';
        echo '<p>'.$Blekko[$nag_c]['snippet'].'<p>';
        echo '<b>'.$Blekko[$nag_c]['engine'].'</b>';   
        echo '<hr>';
   $nag_c =0;
    while ($nag_c <= $google_count)
        echo '<a href='.$google[$nag_c]['url'].'><h4>'.$google[$nag_c]['url_title'].'</h4></a>';
        echo '<p>'.$google[$nag_c]['snippet'].'</p><br>';
        echo '<b>'.$google[$nag_c]['engine'].'</b><br>';
        echo '<hr>';
    while ($nag_c<=$bing_count)
        echo '<a href='.$bing_results[$nag_c]['url'].'>'.'<h4>'.$bing_results[$nag_c]['url_title'].'</h4></a>';
        echo '<p>'.$bing_results[$nag_c]['snippet'].'</p>';
        echo '<b>'.$bing_results[$nag_c]['engine'].'</b>';
        echo '<hr>';
case 'Bing':
    $binger = 0;
    while ($binger<=$bing_count)
        echo '<a href='.$bing_results[$binger]['url'].'>'.'<h4>'.$bing_results[$binger]['url_title'].'</h4></a>';
        echo '<p>'.$bing_results[$binger]['snippet'].'</p><br>';
        echo '<b>'.$bing_results[$binger]['engine'].'</b><br>';
        echo '<hr>';
case 'Blekko':
    $blekr = 0;
    while ($blekr<=$blekko_count)
        echo '<a href='.$Blekko[$blekr]['url'].'><h4>'.$Blekko[$blekr]['url_title'].'</h4></a>';
        echo '<p>'.$Blekko[$blekr]['snippet'].'<p>';
        echo '<b>'.$Blekko[$blekr]['engine'].'</b>';   
        echo '<hr>';
case 'Google':
    $froo = 0;
    while ($froo <=$google_count)
        echo '<a href='.$google[$froo]['url'].'><h4>'.$google[$froo]['url_title'].'</h4></a>';
        echo '<p>'.$google[$froo]['snippet'].'</p>';
        echo '<b>'.$google[$froo]['engine'].'</b>';
        echo '<hr>';


#2 trq

  • Staff Alumni
  • Advanced Member
  • 31,041 posts

Posted 29 July 2013 - 11:48 AM

So where is bing_results defined?

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users