Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

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
Maqs.


Comment on RE: 5 of 10?
Download Code
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.

    -T.McWee

    The Autonomic Pilot

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://11415]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (12)
As of 2014-12-22 22:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (132 votes), past polls