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

    Join Date
    Aug 2000
    Posts
    4
    Rep Power
    0
    I'm trying to pass values from one php page to another... is this the correct way of doing it?

    <a href="viewbook2.php?OFFSET=$OFFSET+$ROWS">
    Next
    </a>

    help on this would be mucho appreciated
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2000
    Location
    Washington, USA
    Posts
    52
    Rep Power
    14
    Hmmm not sure if $ROWS was a separate variable, but if so, then you should separate by & if you have multiple variables you want to sent through query string.

    <BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">code:</font><HR><pre>
    print("<a href="viewbook2.php?OFFSET=$OFFSET&ROWS=$ROWS">Next</a>");
    [/code]

    You can also send through a hidden form so your url location bar doesn't get all ugly by doing:

    <BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">code:</font><HR><pre>
    <input type="hidden" name="OFFSET" value="<? echo($OFFSET); ?>";
    <input type="hidden" name="ROWS" value="<? echo($ROWS); ?>";
    [/code]

    Cookies is, of course a third possible method ... hope this helps


    ------------------
    <UL TYPE=SQUARE>
    <LI> TD Scripts
    <LI> Script School
    <LI>php-scripts
    </UL>

    [This message has been edited by TDavid (edited August 30, 2000).]
  4. #3
  5. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2000
    Posts
    4
    Rep Power
    0
    well not exactly... what I really want to do is add the value of $ROWS to the value of $OFFSET so that each time the page is called redundantly it displays a different set of entries.

    basically, add 10 more to offset each time the page is called.
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2000
    Location
    Ontario, Canada
    Posts
    498
    Rep Power
    18
    Use a hidden INPUT tag...

    eg; <input type="hidden" name="new_offset" value="<?php $newoffset=$offset+10; echo $newoffset?>">

    and when you call the next page, set the original offset variable to $new_offset

    eg; <a href="page.php?offset=<?php echo $new_offset?>">Next 10 results</a>



    ------------------
    To alcohol! The cause of, and solution to, all of life's problems. -- Homer Simpson

Similar Threads

  1. Passing POST variables
    By rlorenzo in forum PHP Development
    Replies: 11
    Last Post: June 6th, 2004, 02:00 PM
  2. Replies: 7
    Last Post: February 16th, 2004, 02:55 PM
  3. help with assigning variables, variable passing/ retrieval
    By pinkipodmini in forum PHP Development
    Replies: 0
    Last Post: February 13th, 2004, 09:40 PM
  4. Why variables aren't passing through the include()
    By sapien in forum PHP Development
    Replies: 7
    Last Post: November 12th, 2003, 09:35 PM
  5. Help passing variables from a text file via include()
    By c4ctuz in forum PHP Development
    Replies: 4
    Last Post: October 14th, 2003, 08:00 AM

IMN logo majestic logo threadwatch logo seochat tools logo