Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris

RE: 5 of 10?

by Maqs (Deacon)
on May 13, 2000 at 12:22 UTC ( #11415=note: print w/replies, xml ) Need Help??

in reply to 5 of 10?

The principal solution is to export the number of the last entry through post, i.e.: a href="myscript.cgi?entry=5"
Then you can use the following routine in your script:
if ($entry >=5) {my $backnum= $entry-5} else {my $backnum=0}; my $nextnum=$entry+5; while ($entry % 5) { #do your output stuff ; $entry++; if ($backnum) { print "<a href=\"myscript.cgi?$backnum\">Previous</ +a>"}; }; print "<a href=\"myscript.cgi?$nextnum\">Next</a>"}; #other stuff...
However, if you would not use CGI module at all, you may parse parameters as $ARGV[0]
You might make a check for the nnumber of entries not to make your Next link to the enmpy page.
With best regards

Replies are listed 'Best First'.
RE: RE: 5 of 10?
by mcwee (Pilgrim) on May 14, 2000 at 23:22 UTC
    Not to be a noodge, but isn't that get that pases data through the URL, not post?

    Either way, I'm all about using argv[0] for this sort of thing-- it works great for situations where you need to pass data but don't really need the functionality of a form, and I tend to botch it much less frequently than I botch get and post.


    The Autonomic Pilot

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://11415]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (4)
As of 2018-05-20 10:38 GMT
Find Nodes?
    Voting Booth?