PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
I am trying to get this script to work. It will skip to the next page, but it will only go to the next page using the file name, which happens to be puppy_listing.php, it will not include the variable is if they exist, I don't know what I'm doing wrong. Here is where I am using the script (an examle with a variable) http://www.lovealotkennels.com/puppy_li ... it322=Sort Any help would be greatly appreciated!! Thanks... Oh yeah, I also have only implemented this script on that page for the top "Skip to Page" not the one at the bottom...
that worked great, the only thing is, now it's building on itself, is there any way around this? Here is an example of what I mean: http://www.lovealotkennels.com/puppy_li ... =2?&page=1
it just continues to build pages, it seems to be working, but I just wonder if there is a clean way of doing this.
Sorry for the "Spaghetti" Code, a guy developed this for me and I am modifing it. I'm pretty new to php. Thanks so much for the help, this is invaluable!
That is because you are keeping the query string when you use $_SERVER['REQUEST_URI']. You might want to try replacing it with basename($_SERVER['SCRIPT_FILENAME']) or something like that.
plain simple english, hopefully...
I have created the ability to sort the data from mysql and display it on the page, http://www.lovealotkennels.com/puppy_listing.php, it displays the data dynamically. It creates a variable like "q=Yorkshire&Submit322=Sort", I found that after I created the sorting capability that my pages no longer linked properly because it was creating dynamically generated pages. So, I wanted to add the new page number to the end of the previous variable in order to keep the sorted data but move on to page 2 or 3 of that data. I would like it if the variable stream did not continue to get longer exponentially as page numbers are added to it, which it currently is. I would like to remove the last page number that was sent (if there was one) and add the new one to the end of the variable. I hope that makes sense. I ought to have my wife type this cause I'm usually as confusing as can be, at least she says . Thanks for any help...
<?php
$page = null;
// I would like to remove the last page number that was sent (if there was one)
if (isset($_GET['page']))
{
// and add the new one to the end of the variable
$page += 1;
}
if (is_null($page))
{
// there was not page query string data
// You should handle this
echo $page; // Or append it, or whatever. Play with this and see what you can do with it
}
?>