Pogledajte određenu poruku
Staro 09. 04. 2011.   #2
webarto
expert
Grand Master
 
Avatar webarto
 
Datum učlanjenja: 11.04.2010
Poruke: 998
Hvala: 141
959 "Hvala" u 153 poruka
webarto is on a distinguished roadwebarto is on a distinguished roadwebarto is on a distinguished roadwebarto is on a distinguished roadwebarto is on a distinguished roadwebarto is on a distinguished roadwebarto is on a distinguished roadwebarto is on a distinguished road
Default

Učitaj kompletan text iz baze u varijablu, text odvoji recimo sa <hr />, ili nešto što nećeš koristiti u textu. Uradi explode čitavog texta, da dobiješ tih recimo 5 stranica. Onda učitaj stranicu preko GET i ispiši taj dio.

PHP kôd:
$text explode("<hr />"$text);

$stranica intval($_GET["stranica"]) - 1;

echo 
$text[$stranica];

$count count($text);

for(
$i 1;$i <= $count$i++){
    
$li .= '<li><a href="?stranica='.$i.'">'.$i.'</a></li>';
}
echo(
'<ul class="stranice">'.$li.'</ul>'); 

Poslednja izmena od webarto : 09. 04. 2011. u 09:39.
webarto je offline   Odgovorite uz citat