#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2000
    Posts
    11
    Rep Power
    0
    I browsed the Net to find an effective "Next-Previous page" script and I found this...

    if ($offset>1) { // bypass PREV link if offset is 0
    $prevoffset=$offset-$limit;
    print "<a href="$PHP_SELF?offset=$prevoffset"><font face="Verdana, Arial, Helvetica, sans-serif" size=2 color=#000000><u>&#60;&#60;&#60;</u></font></a> &nbsp; n";
    }

    This is just the PREV portion. Well, the problem is that I can't scroll through dynamic pages, as the PHP_SELF variable refers only to the file itself. In a file called this was "/template.php?category=cars" the script just gets me to the previous or next page of "/template.php". How can I build next and previous link that can include the variables I'm passing through the URL?
    Thanks in advance for any help.
  2. #2
  3. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2000
    Posts
    23
    Rep Power
    0
    Change the $PHP_SELF?offset=$prevoffset to thepageyouwant?offset=$prevoffset&yourvariable=whatever

    so for you:
    <a href"template.php?offset=$prevoffset&category=cars"> blabla </a>

    Good Luck
    Dave
  4. #3
  5. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2000
    Posts
    11
    Rep Power
    0
    Dave, thanks for your help. Most unfortunately, I don't think your suggestion fits my needs. First of all, should I rename the PHP file I would need to go and change the link. And, most important, $category is not always 'car', as the page is dynamically built. What I would need is a script that can take anything from the URl except for the offset value.
  6. #4
  7. No Profile Picture
    Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2000
    Location
    Cape Town, South Africa
    Posts
    18
    Rep Power
    0
    You should take a look at PHP Builder's article. I'm not sure if it's exactly what you are looking for, but you may find it helpful. Be aware that the code is sort of a very basic guide and that you will need to make some modifications, although it's really good. Here's the link to the article, I suggest you also read the user comments.
    http://www.phpbuilder.com/columns/rod20000221.php3

Similar Threads

  1. Replies: 11
    Last Post: February 21st, 2004, 07:48 AM
  2. Replies: 4
    Last Post: February 13th, 2004, 04:31 PM
  3. include external page that uses cookies
    By micahbdavis in forum PHP Development
    Replies: 1
    Last Post: February 9th, 2004, 05:03 PM
  4. Replies: 0
    Last Post: February 8th, 2004, 11:11 PM
  5. passing the url from HTML page to a php
    By lordorkus in forum PHP Development
    Replies: 10
    Last Post: January 20th, 2004, 06:36 PM

IMN logo majestic logo threadwatch logo seochat tools logo