Adding data from from url in Pagination Class
Place for comments, problems, questions, or any issue related to the JavaScript / PHP scripts from this site.
-
JanMolendijk
- Posts: 244
- Location: Holland Rotterdam
Adding data from from url in Pagination Class
Chief I hope you don't get a headache from me
About a year and a half ago you added an id detection from url in the pagination class from
coursesweb.net/php-mysql/pagination-class-script_s2
yesterday I spent 6 hours studying how you did that but I didn't find the solution.
I would like to have album + name from the url also
Album-Pictures.php?name=Guest&album=Nature
Code: Select all
<?php
$album = isset($_GET['album']) ?(int) $_GET['album'] :'';
$name = isset($_GET['name']) ?(int) $_GET['name'] :'';
//your code ..
?>
The first page is normal working but when i skip to the second page &pg=1
I cant create $name $album into next pages
Code: Select all
<?php
$files = glob("albums/upload/Show/Maps/$_GET[name]/$_GET[album]/*.*");
for ($i=0; $i<count($files); $i++)
{
$num = $files[$i];
}
?>
I need to do something in the class.pagination.pictures.album
but I really don`t know how what to do after many tryouts ???????
Code: Select all
$re =''; // the variable that will contein the links and will be returned
$pg =($str=='')?'?pg=':'?'.$str.'&pg='; // the name for the GET value added in URL
Admin
The pagination class has a method getLinks(str) that returns the pagination links with the value from $str in href attribute.
In the place where you call that method to dispay the pagination links call it with data from url as argument, like this:
Code: Select all
$album = isset($_GET['album']) ?strip_tags($_GET['album']) :'';
$name = isset($_GET['name']) ?strip_tags($_GET['name']) :'';
$name_album ='name='.$name.'&album='.$album;
//outputs the pagination links
echo $objPg->getLinks($name_album);
Similar Topics
-
Php Class COM not found
PHP - MySQL
First post
I've been trying to use the PHP COM class in my script:
$voice = new COM('SAPI.SpVoice');
but I get receiving the following error.
Fatal...
Last post
From PHP 5.4.5, COM and DOTNET is no longer built into the php core.
You have to add COM support in php.ini. Add the following code to the end of...
-
Get Previous Next ID in Pagination script
PHP - MySQL
First post
I have a little script that have a Previous & Next button.
My problem is I want to detect & place the ID in those buttons
this is the...
Last post
Sorry, I not understand your code, not know what it is not working.
Where in the pagination you add $row ?
Do you get any error, or what value the...
-
Adding watermark to PDF with php
PHP - MySQL
First post
Coursesweb next problem I try for hours to add watermark in my php document.
I getting errors or non result
class PDF_Rotate extends FPDF is...
Last post
Well, it can't be helped; I'm not so good with pdf in php.
-
Adding string from database into PDF
PHP - MySQL
First post
Hello Coursesweb I have a problem with my php document to convert it to PFD
I cant find out how to get results from $users into the HTML to the PDF...
Last post
Thanks MarPlo I prefer not to ask anything on stackoverflow.com
because I once typed a small i instead of I.
and received many comments about it....
-
Adding jquery script to two buttons
JavaScript - jQuery - Ajax
First post
Dear admin I try to add two buttons in one off your scripts for opening via button
but i cant find out what i`m doing wrong one is opening but...
Last post
Hello,
There is no attribute id_1 . You can change the value of an atribute, but not its name.
You can use the same js script for multiple buttons;...