PHP Forums Archive

[my pagina] Add parameter in navigation's url

Tags: pagination, query string

fabrice posted on 2008-04-17 08:19:15 #

Hi,

I would to know, how I can add a (url)parameter in the navigation's function, like that :

mypage.php?page=1&id=18&rep=myrep

=> function navigation($addUrl='', $separator = "|" ... ... ...);

Regards,
Fabrice

Comments / discussions

Olaf posted on 2008-04-17 09:08:21 #

You don't need that, the class takes care about existing query strings

fabrice posted on 2008-04-17 09:27:54 #

hello,

Ok, but I generate the parameters in the same page. And so, I build the pagination

Regards,
Fabrice

Olaf posted on 2008-04-17 09:47:44 #

Quote from: fabrice
"hello,
Ok, but I generate the parameters in the same page. And so, I build the pagination
Regards,
Fabrice"

Are you able to post this parameter to the "first" page where the pagination is used?

or try this:

$_GET['id'] = 18;
$_GET['rep'] = 'myrep';

above the code where the class is called

fabrice posted on 2008-04-17 13:03:43 #

Re :)
No, passing my variables by $_GET don't work as well. But I if do this :

$_SERVER['QUERY_STRING'].= 'selected_rep='.$Id.'|'.urlencode($Nom).'&ok=ok';

, it's fine.

But I really don't like....
Have you an another more "elegant" solution ?. I think passing an extended urls (parameters) in the navigation's function is more efficient.

Regards,
Fabrice

Olaf posted on 2008-04-17 13:36:01 #

sure you can extend the class and modify the method

function rebuild_qs($curr_var) {
...

check this "multi" function here

fabrice posted on 2008-04-17 13:47:11 #

Yes, I've already seen this function.

And I'll modify the class.

Regards,
Fabrice