Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
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
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.

    -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 surveying the Monastery: (11)
As of 2015-07-30 19:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (273 votes), past polls