PDA

View Full Version : How to manipulate $_GET?


ThorstenA
08-14-2007, 07:44 PM
I want to make a hook in memberlist.php and therefore want to change an empty $sortfield = $vbulletin->input->clean_gpc('r', 'sortfield', TYPE_STR); to value 'lastvisit'. How can I manipulate the $_GET variable?

nico_swd
08-14-2007, 09:40 PM
You have to edit the $_REQUEST variable.



if (empty($_REQUEST['sortfield']))
{
$_REQUEST['sortfield'] = 'lastvisit';
}

Dismounted
08-16-2007, 12:02 PM
That might not work as he's cleaning it. Try this:
if (empty($vbulletin->GPC['sortfield']))
{
$vbulletin->GPC['sortfield'] = 'lastvisit';
}

ThorstenA
08-16-2007, 12:14 PM
both codes work great! Thank you both very much!