Here is the code:
echo("<font size='1'><a href='print.php?aid=$aid'>Print this Article</a></font><br><br>");
echo("<font size='6'>$title</font><br><font size='1' color='#0099FF'>by $name</font><br><br>");
if (!isset($page)) $page = 0;
// TEMPORARY TOKEN TO MAKE SURE SPLIT WORKS
$text = eregi_replace('([pagebreak][[]+[/pagebreak ])', '!!!TEMP-TOKEN!!!\1', $text);
// SPLIT
$pagestemp = split('!!!TEMP-TOKEN!!!', $text);
// TITLE FIRST PAGE
$pagestemp[0] = '[pagebreak]Introduction[/pagebreak]' . $pagestemp[0];
// GET TITLE FROM TAGS
eregi('[pagebreak]([[]+)[/pagebreak]', $pagestemp[$pagenumber], $pagenametemp);
//GET TITLE
$pagename = $pagenametemp[$page];
echo $pagename;
echo( "<br><br><font size='2'><P>$text</p></font>" );
// NEXT AND PREVIOUS PAGE LINKS
if ($page != 0) {
$prevpage = $page - 1;
echo("<A HREF=\"$PHP_SELF?aid=$aid&page=$prevpage\">".
"Previous Page</A> ");}
if ($page < count($textarray) - 1) {
$nextpage = $page + 1;
echo(" <A HREF=\"$PHP_SELF?aid=$aid&page=$nextpage\">".
"Next Page</A>");}
The aim of this is to split the article into a new page when it comes to [pagebreak]Title[/pagebreak] and select the title from that tag. Except it doesn't split the pages up, doesn't display the title, and only displays:
!!!TEMP-TOKEN!!![pagebreak]Title[/pagebreak]
Does anyone know why this doesn't work?