Jackal Posted February 8, 2007 Report Share Posted February 8, 2007 Uztaisiju skriptu, kas sadala izvilkotos datus no db lapās. Uz FF un Operas viss iet normāli, bet IE, gadījumā, kad izpildas pēdējais if, parāda divus linkus uz nākamo lapu, vajadzēja parādīt tikai vienu. To otru linku viņš parāda ārpus tabulas. Kas varētu būt par problēmu? $rows = mysql_num_rows(mysql_query("SELECT * FROM tabula")); $link = 'index.php?id=darbi'; $pages = ceil($rows / $limit); if($pages != 1){ echo '<div><table><tr>'; if($page != 1){ echo '<td>'; echo '<a href="'.$link.'&page='.($page - 1).'">«</a>'; echo '</td>'; } for($i = $page - 4; $i <= $page + 4; $i++){ if($i <= 0 || $i > $pages){ echo ''; } else { echo '<td>'; echo '<a href="'.$link.'&page='.$i.'">'.($i == $page ? '<b>'.$i.'</b>' : $i).'</a>'; echo '</td>'; } } if($page != $pages){ echo '<td>'; echo '<a href="'.$link.'&page='.($page + 1).'">»</a>'; echo '</td>'; } echo '</tr></table></div>'; } Link to comment Share on other sites More sharing options...
bubu Posted February 8, 2007 Report Share Posted February 8, 2007 php izpildās servera pusē. Ar klienta izmantoto browseri tam nav nekāda sakara. Link to comment Share on other sites More sharing options...
andrisp Posted February 9, 2007 Report Share Posted February 9, 2007 Iekopē uzģenerēto html kodu šeit. Link to comment Share on other sites More sharing options...
rpr Posted February 9, 2007 Report Share Posted February 9, 2007 nu zveeraa koderis! kas ir $limit? kas ir $page? ja neraadaas normaali html, tad saac ar html valideeshanu. veel nesaprotu kaapeec tabula jaaliek divaa un vispaar prieksh kam vajag tabulu? Link to comment Share on other sites More sharing options...
v3rb0 Posted February 9, 2007 Report Share Posted February 9, 2007 (edited) atkal $rows = mysql_num_rows(mysql_query("SELECT * FROM tabula")); varbūt vajag nākošajā php versijā tadu mysql_num_rows() izņemt ārā? Edited February 9, 2007 by v3rb0 Link to comment Share on other sites More sharing options...
Recommended Posts