I'm writting little forum script, and I need help a bit. I want, that in one page would show like 10 or 20 threads and on bottom links to other pages, but I can't figure out how to do that. There is part of code (I know, it's crappy):
PHP Code:
<table width="596" cellspacing="1" cellpadding="7"> <?php $handle = opendir("./dati/forums/t"); while (($file = readdir($handle))!==false) { if ($file != "." && $file != "..") { $fails= fopen("./dati/forums/t/$file", "r"); $dati = fread($fails, filesize("dati/forums/t/$file")); list($niks, $nosaukums, $teksts, $datums, $ip) = explode("|", $dati); $links = str_replace(".txt", "", $file); ?> <tr> <td> <b><a href="?id=<?php echo "$links"; ?>"><?php echo "$nosaukums"; ?></a></b> autors: <a href="?id=profils&lietotajs=<?php echo "$niks"; ?>"><?php echo"$niks"; ?></a> @ <?php echo "$datums"; ?><br /> </td> </tr> <?php fclose($fails); } } closedir($handle); ?> </table>
Sorry, it's in latvian, but I hope you will understand everything 
|