Map of the last flights of the pilot

Hi, i add my code:

<?php
if(!$pireps)
{
  echo '<p>Sorry No recent flights have been found</p></div>';
  return;
}
        $flights = PIREPData::getLastReports($userinfo->pilotid, '20');                                                                     
       $string = "";
       foreach($flights as $flight)
       {       
               $string = $string.$flight->depicao.'+-+'.$flight->arricao.',+';
       }
?>
<p align="center"><strong>Pilots Recent Flights</strong><br /><img src="http://www.gcmap.com/map?P=<?php echo $string ?>&MS=bm&MR=240&MX=685x360&PM=pemr:star10:white%2b%22%25I%22:white&PC=orange" /><br />
             Maps generated by the <a href="http://www.gcmap.com/">Great Circle Mapper</a> - copyright © <a href="http://www.kls2.com/~karl/">Karl L.Swartz</a></p>

but for pilots with one flight the result are:

http://bluepanoramava.joomlafree.it/phpVMS/index.php/profile/view/3233

and for pilots without one flight the result are:

http://bluepanoramava.joomlafree.it/phpVMS/index.php/profile/view/9139

Why???

Thanks!

Hi, i add my code:

<?php if(!$pireps) { echo '

Sorry No recent flights have been found

'; return; } $flights = PIREPData::getLastReports($userinfo->pilotid, '20'); $string = ""; foreach($flights as $flight) { $string = $string.$flight->depicao.'+-+'.$flight->arricao.',+'; } ?>

Pilots Recent Flights

Maps generated by the Great Circle Mapper - copyright © Karl L.Swartz

but for pilots with one flight the result are:

http://bluepanoramav…ofile/view/3233

and for pilots without one flight the result are:

http://bluepanoramav…ofile/view/9139

Why???

Thanks!

Replace

echo '<p>Sorry No recent flights have been found</p></div>';

to

echo '<p>Sorry No recent flights have been found</p>';

(that removes the extra </div>)

Kindest Regards,

James

Oh

Thanks!