TheAdminMarket
10-17-2014, 04:08 PM
Hello all,
Does anybody know what appears in the URL when one parameter is array? eg:
&genders=Array&roles=Array
is correct?
Actually it must be correct as the pagination works just fine (I mean navigating between the pages), but I can't get the values for another action that I want.
Testing the 1st page with:
if (is_array($genders))
{
echo "1";
print_r($genders);
}
I'm getting: 1Array ( [0] => 1 [1] => 2 ) which is correct. But moving to any other page I'm getting: 1Array ( ) . Empty array.
The most important parts of the code before are:
$vbulletin->input->clean_array_gpc('r', array(
'homeform' => TYPE_INT,
'genders' => TYPE_ARRAY_INT,
'roles' => TYPE_ARRAY_INT,
....
));
$genders = $vbulletin->GPC['genders'];
$roles = $vbulletin->GPC['roles'];
// Below I've the code for counting the amount of rows etc etc.
..........
// Storing the values to pass them as parameters
$postvalues .= "&genders=".$genders;
$postvalues .= "&roles=".$roles;
// Finally building the page navigation
$pagenav = construct_page_nav($pagenumber, $perpage, $records, 'dating.php?' . $vbulletin->session->vars['sessionurl'] . 'do=searchresults'.$postvalues.'');
I also tried in postvalues:
$postvalues .= "&genders=".implode(',',$genders);
This changed the URL to &genders=1,2 but still can't get the values. Don't know if in this case I must use: TYPE_STR instead of TYPE_ARRAY_INT
Any idea is welcome :)
Thank you
Does anybody know what appears in the URL when one parameter is array? eg:
&genders=Array&roles=Array
is correct?
Actually it must be correct as the pagination works just fine (I mean navigating between the pages), but I can't get the values for another action that I want.
Testing the 1st page with:
if (is_array($genders))
{
echo "1";
print_r($genders);
}
I'm getting: 1Array ( [0] => 1 [1] => 2 ) which is correct. But moving to any other page I'm getting: 1Array ( ) . Empty array.
The most important parts of the code before are:
$vbulletin->input->clean_array_gpc('r', array(
'homeform' => TYPE_INT,
'genders' => TYPE_ARRAY_INT,
'roles' => TYPE_ARRAY_INT,
....
));
$genders = $vbulletin->GPC['genders'];
$roles = $vbulletin->GPC['roles'];
// Below I've the code for counting the amount of rows etc etc.
..........
// Storing the values to pass them as parameters
$postvalues .= "&genders=".$genders;
$postvalues .= "&roles=".$roles;
// Finally building the page navigation
$pagenav = construct_page_nav($pagenumber, $perpage, $records, 'dating.php?' . $vbulletin->session->vars['sessionurl'] . 'do=searchresults'.$postvalues.'');
I also tried in postvalues:
$postvalues .= "&genders=".implode(',',$genders);
This changed the URL to &genders=1,2 but still can't get the values. Don't know if in this case I must use: TYPE_STR instead of TYPE_ARRAY_INT
Any idea is welcome :)
Thank you