SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Member
    Join Date
    Dec 2007
    Posts
    15
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question PHP Reproducing Links

    Hello

    I have question on my php script:

    <center>Pages <?php $count = 1; while ($count <= 10) {echo "<a href='profile.php?type=$type&Name=$name&page=1' rel='$name' title='$name'>$count</a> "; ++$count;} ?></center>

    This script reproduces the link dynamically but I have been unable to change the page number "page=1"!

    I tried doing it like this but did not work:

    <center>Pages <?php $count = 1; while ($count <= 10) {echo "<a href='profile.php?type=$type&Name=$name&page=<?php $count = 1; while ($count <= 10) {echo "$count"; ++$count;} ?>
    ' rel='$name' title='$name'>$count</a> "; ++$count;} ?></center>

    but it did not work...

    Now the question is what is the right way?

  2. #2
    From Italy with love silver trophybronze trophy
    guido2004's Avatar
    Join Date
    Sep 2004
    Posts
    9,509
    Mentioned
    163 Post(s)
    Tagged
    4 Thread(s)
    Code:
    <?php 
      $count = 1; 
      while ($count <= 10) {
        echo "<a href='profile.php?type=$type&Name=$name&page=$count' rel='$name' title='$name'>$count</a> ";
        ++$count;
      } 
    ?>

  3. #3
    SitePoint Member
    Join Date
    Dec 2007
    Posts
    15
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Smile

    Thank you so much


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •