I use this for a guestbook, the data is sent via get with a simple link.

# number of rows in db, this is actually pulled from the # database, i'll just do 1000 here. my $termNUM = 1000; my $numberset = param('value'); # if no value is passed or if someone passes 0 # this sets it to 1 if ($numberset eq "") { $numberset = 1; } elsif ($numberset eq 0) { $numberset = 1; } $origNUM = $termNUM - 25; # 25 is the entries i want to view per page $termNUM = $rowNUM - (($numberset - 1) * 26); # 26 is the entries plus 1, i guess i could have set a variable, but i +'m lazy

to generate the links, i use a subroutine:

sub Test25 { if ($termNUM < $rowNUM) { print "<div style=\"text-align: left; float: left;\"><a href=\"?va +lue=".($numberset - 1)."\">View Previous 25 Entries</a></div>\n"; } if ($origNUM > 1) { print "<div style=\"text-align: right; float: right;\"><a href=\"? +value=".($numberset + 1)."\">View Next 25 Entries</a></div><BR>\n"; } }

you'll have to modify this a bit for your own use.

--
paul


In reply to Re: math mistake? by vbrtrmn
in thread math mistake? by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.