Jump to content

Recommended Posts

Need some help that should be pretty basic, but it's stumping me.

 

I have a page that's displaying data from the database. I have a pull-down menu that let's the user select specific fields to display all entries that share fields.  I use the GET form method, and the URL looks like this:

 

/display.php?search=name

 

In the code I have a pagination setup (for "next page" and "previous page" text links) however those links don't seem to add their string to the end of the existing search string.

 

Instead of /display.php?search=name&pageno=2 (which works if I type it in)

 

I get

 

/display.php?page=2

 

and by doing that I lose the search criteria and it displays all items in the database (which is the default if no search is defined). The pagination PHP code uses this for the link is:

 

<a href='{$_SERVER['PHP_SELF']}?pageno=$nextpage'>NEXT</a>

 

Even when I remove the $_SERVER and PHP_SELF references, it doesn't add the pageno= string to the existing ?search= string.

 

Is there a way to extract the full URL string and append the &pageno string to it?

 

In short, I need a way to retain the existing "?search=" values in the URL while adding "&pageno=" to the end.

 

Did that make any sense? :)

 

Any assistance would be greatly appreciated.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.