jailbox 0 Report post Posted November 12, 2004 Can anyone help me with pagination of a txt file which looks something like this:some message <br/>some message <br/>some message <br/>some message <br/>some message <br/>some message <br/>some message <br/>The <br/> tag is the end of the message. Anyone? Share this post Link to post Share on other sites
Roly 0 Report post Posted November 13, 2004 pagination? what? Share this post Link to post Share on other sites
jailbox 0 Report post Posted November 13, 2004 Atleast the guys at devshed know what it is. You know, in google, it divides the search results in multiple pages. I want it to do it with a txt file Share this post Link to post Share on other sites
X3r0X 0 Report post Posted November 13, 2004 Thats incorrect. It should be <BR> instead of </BR>. It seems like the person was trying to use another forum of HTML and trying to close the brackets Share this post Link to post Share on other sites
jailbox 0 Report post Posted November 13, 2004 Thats incorrect. It should be <BR> instead of </BR>. It seems like the person was trying to use another forum of HTML and trying to close the brackets <{POST_SNAPBACK}> I forgot to mention that its not html. Its wml. For wap. So <br/> is 100% correct Share this post Link to post Share on other sites
krap 0 Report post Posted November 18, 2004 He said <br/> not </br> anyway Share this post Link to post Share on other sites
Hamtaro 0 Report post Posted November 19, 2004 Even in regular HTML, <br/> is also correct. Many HTML tags that don't have a closing tag (like <img>) can also be used that way. Anyway, back on topic:I'm sorry, but I have no idea how I could help you...sorry! Share this post Link to post Share on other sites
mizako 0 Report post Posted November 21, 2004 I suppose you want to provide pagination using PHP. I created a guestbook with pagination for one of my pages. Basically i have all my entries in a MySQL database and using php code i achieve pagination. Maybe if you do not want to use a database, you can modify the algorithmus a little bit to work with text files.Here is my code: [/br]<?php[br] $sql_db = "Db_Name";[/br] $sql_user = "Db_User";[br] $sql_pass = "Db_Passwd";[/br] $sql_table = "Db_Table";[br] [/br] if(isset($pos)==0)[br] $pos=0; // start position for the page indexer[/br] $count=3; // number of displayed items per page[br] [/br] mysql_connect("localhost", $sql_user, $sql_pass);[br] mysql_select_db($sql_db);[/br] $result = mysql_query("select MAX(id) from ".$sql_table.";");[br] $data = mysql_fetch_assoc($result);[/br] $size = $data['MAX(id)'];[br] $result = mysql_query("SELECT * FROM ".$sql_table." where id>".$pos.";");[/br] if($result)[br] {[/br] $i=0;[br] while(($data = mysql_fetch_assoc($result)) && ($i < $count))[/br] {[br] // Here you should add text[/br] $i++;[br] }[/br] }[br] mysql_close();[/br] print "<div>Pages:";[br] for($j=0; $j<$size; $j++)[/br] if(!($j % $count))[br] print "<a href=\"book.php?pos=".$j."\">".(($j/$count)+1)."</a>\n";[/br] print "Total number of entries: ".$size."\n";[br] if ($pos > 0)[/br] print "<a href=\"book.php?pos=".($pos-$count)."\">Back</a>\n";[br] if($size > $pos+$count)[/br] print "<a href=\"book.php?pos=".($pos+$count)."\">Next</a>\n";[br]?>[/br] Let me know if i can help you in oder way. Share this post Link to post Share on other sites