ercio Posted September 27, 2015 Report Share Posted September 27, 2015 I got this error Warning: Invalid argument supplied for foreach() in /home/ercio/public_html/lib/skins/lance/frontpage_recentpilots.tpl on line 3 <ul style="margin-top:10px; margin-left:3px;width:100%;" class="list-group"> <?php foreach($allpilot_list as $allpilot) { ?> <li class="list-group-item"><img src="<?php echo Countries::getCountryImage($pilot->location);?>" alt="<?php echo Countries::getCountryName($pilot->location);?>" /> <a href="<?php echo url('/profile/view/'.$pilot->pilotid);?>"><font color="#2f2f2f"><?php echo $pilot->firstname.' '.$pilot->lastname ?></font></a></li> <?php } ?> </ul> Quote Link to comment Share on other sites More sharing options...
Moderators servetas Posted September 27, 2015 Moderators Report Share Posted September 27, 2015 It seems that you are using a wrong variable on your foreach. Can you try using this instead? <ul style="margin-top:10px; margin-left:3px;width:100%;" class="list-group"> <?php foreach($pilots as $allpilot) { ?> <li class="list-group-item"><img src="<?php echo Countries::getCountryImage($pilot->location);?>" alt="<?php echo Countries::getCountryName($pilot->location);?>" /> <a href="<?php echo url('/profile/view/'.$pilot->pilotid);?>"><font color="#2f2f2f"><?php echo $pilot->firstname.' '.$pilot->lastname ?></font></a></li> <?php } ?> </ul> Quote Link to comment Share on other sites More sharing options...
ercio Posted September 27, 2015 Author Report Share Posted September 27, 2015 it gaves me an X look www.virtualvarig.com thank you man again Quote Link to comment Share on other sites More sharing options...
Moderators servetas Posted September 27, 2015 Moderators Report Share Posted September 27, 2015 This should work correctly: <ul style="margin-top:10px; margin-left:3px;width:100%;" class="list-group"> <?php foreach($pilots as $pilot) { ?> <li class="list-group-item"><img src="<?php echo Countries::getCountryImage($pilot->location);?>" alt="<?php echo Countries::getCountryName($pilot->location);?>" /> <a href="<?php echo url('/profile/view/'.$pilot->pilotid);?>"><font color="#2f2f2f"><?php echo $pilot->firstname.' '.$pilot->lastname ?></font></a></li> <?php } ?> </ul> Quote Link to comment Share on other sites More sharing options...
ercio Posted September 27, 2015 Author Report Share Posted September 27, 2015 thanks man! it works I really recommend this guy services ! fast response Good price! http://php-mods.eu/ . thank you again! SERVETAS Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.