lancey10 Posted February 23, 2006 Share Posted February 23, 2006 how do i make it so a certain amount of text displayed on a page will create a new page to finish reading the text? Link to comment https://forums.phpfreaks.com/topic/3561-paging/ Share on other sites More sharing options...
hitman6003 Posted February 24, 2006 Share Posted February 24, 2006 Well, you could use strlen to find the length of your text, then if it exceeds the length that you have determined to be one page, you could use substr to seperate out only that many characters to display, along with a "next page" link.Of course doing that means that it wouldn't do clean transitions. In other words, if you decided that 10000 characters was one page, and the 10000th character was in the middle of a word, it would cut that word in two. Link to comment https://forums.phpfreaks.com/topic/3561-paging/#findComment-12301 Share on other sites More sharing options...
lancey10 Posted February 24, 2006 Author Share Posted February 24, 2006 [!--quoteo(post=348857:date=Feb 23 2006, 07:16 PM:name=hitman6003)--][div class=\'quotetop\']QUOTE(hitman6003 @ Feb 23 2006, 07:16 PM) [snapback]348857[/snapback][/div][div class=\'quotemain\'][!--quotec--]Well, you could use strlen to find the length of your text, then if it exceeds the length that you have determined to be one page, you could use substr to seperate out only that many characters to display, along with a "next page" link.Of course doing that means that it wouldn't do clean transitions. In other words, if you decided that 10000 characters was one page, and the 10000th character was in the middle of a word, it would cut that word in two.[/quote]is there a script or a tutorial that i can see? Link to comment https://forums.phpfreaks.com/topic/3561-paging/#findComment-12303 Share on other sites More sharing options...
AndyB Posted February 24, 2006 Share Posted February 24, 2006 [a href=\"http://ca.php.net/manual/en/function.str-word-count.php\" target=\"_blank\"]http://ca.php.net/manual/en/function.str-word-count.php[/a] in the manual, and look at the notes provided by webmaster at joshstmarie dot com .. that's what you're asking about. Link to comment https://forums.phpfreaks.com/topic/3561-paging/#findComment-12304 Share on other sites More sharing options...
lancey10 Posted February 24, 2006 Author Share Posted February 24, 2006 thanks but how would it retrive the other half of the text from another page.... tutorial doesnt help with that Link to comment https://forums.phpfreaks.com/topic/3561-paging/#findComment-12308 Share on other sites More sharing options...
lancey10 Posted February 24, 2006 Author Share Posted February 24, 2006 anyone? Link to comment https://forums.phpfreaks.com/topic/3561-paging/#findComment-12341 Share on other sites More sharing options...
litebearer Posted February 24, 2006 Share Posted February 24, 2006 a rough sledgehammer approach would be to create some session variables that will track...1. the original text2. the page you are onwith those two pieces of information you could calculate which portion of text to display and loop through the original text.Probably a clumsy way to do it but it sould work til you can refine it.Lite... Link to comment https://forums.phpfreaks.com/topic/3561-paging/#findComment-12348 Share on other sites More sharing options...
lancey10 Posted February 27, 2006 Author Share Posted February 27, 2006 ook so i tried and still no luck, is there a tutorial or can anyone tell me how to do it step by step? or example script? Link to comment https://forums.phpfreaks.com/topic/3561-paging/#findComment-12833 Share on other sites More sharing options...
stevepatd Posted January 5, 2007 Share Posted January 5, 2007 Wow, this is almost a year old. Did you ever get it figured out??? I have a similar issue where I'm printing several tables. Each table is in the neighborhood of 40 something lines. So, when printed, the page breaks break the table into two. Is there a command you can send to the printer?Thx. Link to comment https://forums.phpfreaks.com/topic/3561-paging/#findComment-153331 Share on other sites More sharing options...
chronister Posted January 5, 2007 Share Posted January 5, 2007 Page 1<br style="page-break-before:always;">Page 2<br style="page-break-after:always;">Page 3This will force the printer to break the page at the requested points. The above would give 3 pages. Link to comment https://forums.phpfreaks.com/topic/3561-paging/#findComment-153396 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.