swamp Posted August 20, 2008 Share Posted August 20, 2008 Hi there... I've got this script that splits up content into chunks of 900 characters into individually numbered divs... $string = $post; $i=1; for($t=0; $t<strlen($string);$t++){ if($t%900==0) $i++; $out[$i].=$string{$t}; } ?> <? foreach($out as $k=>$v) $out[$k]='<div id="content_'.$k.'">'.$v.'</div>'; $out=implode('',$out); echo $out I'm also using some java to show and hide divs so can browse through 'pages' of content without actually changin file. How would i go a about adding in these buttons (previous + next page) into the script: <p><span class="arrow-back"><a href="#" onclick="setVisible('content_0');">previous page</a></span> <span class="arrow"><a href="#" onclick="setVisible('content_1');">next page</a></span></p> Any help really appreciated - Thanks! Link to comment https://forums.phpfreaks.com/topic/120536-individual-divs-with-php/ Share on other sites More sharing options...
s1yman Posted August 20, 2008 Share Posted August 20, 2008 what is the problem you are having when you put that into the script? Link to comment https://forums.phpfreaks.com/topic/120536-individual-divs-with-php/#findComment-621117 Share on other sites More sharing options...
swamp Posted August 20, 2008 Author Share Posted August 20, 2008 one: the apostrophes break it... two: its not dynamic its just content_0 + content_1 ... some of my articles go right up to 4000 characters so i'll need it to be able to go back one or forward one depending where you are.. Cheers! Link to comment https://forums.phpfreaks.com/topic/120536-individual-divs-with-php/#findComment-621121 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.