Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [php]stronnicowanie (Pager)
szmerak
post
Post #1





Grupa: Zarejestrowani
Postów: 286
Pomógł: 12
Dołączył: 23.11.2006
Skąd: WL

Ostrzeżenie: (0%)
-----


Używam skryptu nospora - przepraszam jak pomyliłem nick
i mam taki kodzik: (gdy dzieli mi na strony to nie dzieli mi informacji tylko na dole pokazuje się 1 2 > >> >| jak klikne na 2 to mi się pokazuje to samo co na 1 :/)
  1. <?
  2.  
  3. echo '<LINK REL="stylesheet" HREF="style.css" TYPE="text/css">
  4. <table border=0 cellspacing=0 cellpadding=0 width=100% align=center>';
  5. include("szuk.php");
  6. echo '<center>';
  7. $filmiki = file("file.txt");
  8. $file = file('file.txt');
  9. $firstElement = $file[0];
  10. $explodeFirstElement = explode( '|', $firstElement );
  11.  
  12.  
  13. foreach($filmiki as $filmy)
  14. {
  15. if($_GET['zobacz'] == ""){
  16. require_once('Pager.class.php');
  17.  
  18. $tab = array();
  19. $totalRecords = $explodeFirstElement[0];
  20. try{
  21. $pager = new Pager('idPagera');
  22. $pager->SetTotalRecords($totalRecords);
  23. $pager->SetRecordsPerPage(10);
  24. $pager->SetPagesPerNav(5);
  25. $pag = $pager->Render();
  26. $indexStart = $pager->GetIndexRecordStart();
  27. $indexEnd = $pager->GetIndexRecordEnd();
  28. }
  29. catch (Exception $e) {
  30. echo $e->getMessage();
  31. }
  32.  
  33. echo '<table align=center>';
  34. for ($i=$indexStart; $i<=$indexEnd;$i++)
  35. $podziel = explode("|", $filmy);
  36. $numer = $podziel[0];
  37. echo '<tr>
  38. <td width=180 align=center><a href="?zobacz='.$numer.'"><img src="'.$podziel[3].'" width=120 height=90 border=0></a></td><td 
  39.  
  40. width=100% align=left valign=top><a href="?zobacz='.$numer.'">'.$podziel[1].'</a><br>Data dodania: '.$podziel[4].'<br>Czas: 
  41.  
  42. '.$podziel[5].' min<br>
  43. Dodał: Szmerak</td>
  44. </tr><br>';
  45. }
  46.  
  47.  
  48.  
  49. }
  50. echo '</table>';
  51. echo $pag;
  52.  
  53.  
  54. foreach($filmiki as $filmy)
  55. {
  56. for($x=0; $x<1; $x++){
  57. $podziel = explode("|", $filmy);
  58. $akcja = $podziel[0];
  59. if($_GET['zobacz'] == "$akcja"){
  60. echo '<center>Nazwa: '.$podziel[1].'<br>'.$podziel[2].'<br><a href="index.php">Powrót</a></center>';
  61. }
  62. }
  63. }
  64.  
  65.  
  66.  
  67. ?>


Wiem że robię gdzieś błąd tylko nie wiem gdzie :/
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 20.08.2025 - 13:43