I want to add the choice of splitting pages to the field 'story'. I'm using $myrow['field']s and displaying them with the printf() function.
I can't work out where to put the spliti function. Should it go within printf() for the 'story' $myrow field?
Some advice from PHP people who know would be appreciated very much.
. . . . . . . <my code>
printf(" %s\n<br>",
// Split the text into an array of pages
$textarray = spliti('\[PAGEBREAK]', $result);
// Select the page we want
$result = $textarray[$page];
$PHP_SELF = $_SERVER['PHP_SELF'];
if ($page != 0) {
$prevpage = $page - 1;
echo "<p><a href=\"$PHP_SELF?id=$id&page=$prevpage\">".
'Previous Page</a></p>';
}
echo "<p>$b</p>";
if ($page < count($textarray) - 1) {
$nextpage = $page + 1;
echo "<p><a href=\"$PHP_SELF?id=$id&page=$nextpage\">".
'Next Page</a></p>';
}
$myrow["story"]);
. . . . . .
You can probably see that it doesn't work this way. Help, please, Masters.
I can't work out where to put the spliti function. Should it go within printf() for the 'story' $myrow field?
Some advice from PHP people who know would be appreciated very much.
. . . . . . . <my code>
printf(" %s\n<br>",
// Split the text into an array of pages
$textarray = spliti('\[PAGEBREAK]', $result);
// Select the page we want
$result = $textarray[$page];
$PHP_SELF = $_SERVER['PHP_SELF'];
if ($page != 0) {
$prevpage = $page - 1;
echo "<p><a href=\"$PHP_SELF?id=$id&page=$prevpage\">".
'Previous Page</a></p>';
}
echo "<p>$b</p>";
if ($page < count($textarray) - 1) {
$nextpage = $page + 1;
echo "<p><a href=\"$PHP_SELF?id=$id&page=$nextpage\">".
'Next Page</a></p>';
}
$myrow["story"]);
. . . . . .
You can probably see that it doesn't work this way. Help, please, Masters.