How does that not work?

We don't know what you expect and what you think is wrong with the output.

I assume that you pasted the rendered HTML output, but you may want to reduce your program to the bare minimum. Is the CGI part necessary for testing your program?

Update: Maybe you want to go line by line over this loop and explain what you are doing there and why:

for (my $i = '0'; $i < $nb_page+ 1;$i++) { my $n2 = $i %= 10; $min_index += 40; $string .= "<a href=\"/cgi-bin/recordz.cgi?lang=FR&amp;session +=1&page=historique&amp;article=1amp;min_index=$min_index&amp;max_inde +x=40\" ><-$n2-></a>&#160;&nbsp;"; $nb_page--; }

I suggest you use a Perl-style loop instead of a C-style loop and use

for my $i (0..$nb_page) { ... }

Also, why do you use my $i = '0'; instead of my $i = 0;?

Why do you decrement $nb_page at the end of the loop?

What is the $min_index variable about?

What is the $i variable supposed to hold and why do you keep it below 10?


In reply to Re^13: Need help with pagination by Corion
in thread Need help with pagination by *alexandre*

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.