I am working on a product, building from previously existing products, this is a page within the admincp.
I am wondering why sometimes I am able to pull a GPC variable and other times I am not, I am having this issue in multiple spots but this is just the smallest one to give the example.
I am able to pull the
productid with:
PHP Code:
$vbulletin->GPC['productid']
But I cant get the
catid to pull:
PHP Code:
$vbulletin->GPC['catid']
This is the complete page in question, Just a simple confirmation page.
PHP Code:
$vbulletin->input->clean_array_gpc('r', array(
'productid' => TYPE_UINT,
'catid' => TYPE_UINT
));
print_form_header('digigacp', 'dodeleteproduct');
construct_hidden_code('s', $vbulletin->session->vars['sessionhash']);
construct_hidden_code('adminhash', ADMINHASH);
construct_hidden_code('productid', $vbulletin->GPC['productid']);
construct_hidden_code('catid', $vbulletin->GPC['catid']);
print_table_header($vbphrase['confirm']);
print_description_row($vbphrase['are_you_sure']);
print_description_row('Product ID: ' . intval($vbulletin->GPC['productid']));
print_description_row('Category: ' . intval($vbulletin->GPC['catid']));
print_submit_row($vbphrase['yes'], '', 2, $vbphrase['no']);
A way I get around this is to use a query, but since I can pull the productid, I just dont understand why I cant pull the catid, when they were both submitted through the same form.
This is how I currently solve this problem:
PHP Code:
$vbulletin->input->clean_array_gpc('r', array(
'productid' => TYPE_UINT,
'catid' => TYPE_UINT
));
$info = $db->query_first("SELECT catid
FROM " . TABLE_PREFIX . "products
WHERE productid = " . intval($vbulletin->GPC['productid']) . "
");
print_form_header('digigacp', 'dodeleteproduct');
construct_hidden_code('s', $vbulletin->session->vars['sessionhash']);
construct_hidden_code('adminhash', ADMINHASH);
construct_hidden_code('productid', $vbulletin->GPC['productid']);
construct_hidden_code('catid', $vbulletin->GPC['catid']);
print_table_header($vbphrase['confirm']);
print_description_row($vbphrase['are_you_sure']);
print_description_row('Product ID: ' . intval($vbulletin->GPC['productid']));
print_description_row('Category: ' . $info['catid']);
print_submit_row($vbphrase['yes'], '', 2, $vbphrase['no']);