Forum Moderators: coopster
There are two ways the pages come up , under a gallery or catergory. One page controls the whole lot and since page numbers comes in all sections i have to setup varible page numbers. The problem is i am trying to add 1 extra varible to the $php_self command and it isn't working.
for eg: i go to this catergory
"index.php?mode=thumbs&catergory=pics"
i need to add page number to the end of this when the numbering starts.
i have tried <a href=\"$php_self" . "&page=$pageno\">$pageno </a> this produced - "index.php&page=1"
i tried making a varible and adding it too.
$link = $php_self;
$link = $link . "&page=$pageno";
this also produced "index.php&page=1"
Is there any way i can add my page to the end of the url?
the end result would look something like
"index.php?mode=thumbs&catergory=pics&page=2"
One is a catergory and one is gallery.
Which is why when i grab $php_self i need to add the page=2 to the end of the $php_Self ... i cant hard code in the "?mode=thumbs&catergory=pics". i hope that makes sense.
i guess i could just make it so both varibles are in there but it would be messy.
Thanks for the above reply though. :)
printf( "<a href=\"%s?mode=%s&catergory=%s&page=%d\">%d</a>", $_SERVER['PHP_SELF'], $_GET['mode'], $_GET['catergory'], $pageno, $pageno);
[ edit - a few typos fixed, guess it's late :) ]
but what i was originally trying to so i take the current value of $php_self which could be a variety of things
eg "index.php?mode=thumbs&catergory=pics"
or "index.php?mode=thumbs&gallery=pics"
and just plop a &page=$pageno to the value of $php_self.
if i have to split it all up i will do that