Register Members List Search Today's Posts Mark Forums Read

Reply
 
Thread Tools
  #1  
Old 28 Oct 2020, 15:24
Dr.CustUmz's Avatar
Dr.CustUmz Dr.CustUmz is online now
 
Join Date: Aug 2013
Real name: Ryan
Question Pulling a GPC variable

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:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

But I cant get the catid to pull:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

This is the complete page in question, Just a simple confirmation page.

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

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:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

__________________
I have re-launched vBTeam! No longer will it be a warez site, but an alternative to here. Come Join Us Today!
I like to work with vB3, but if you have a custom request anything vB feel free to PM me!

Last edited by Dr.CustUmz; 28 Oct 2020 at 16:13.
Reply With Quote
  #2  
Old 29 Oct 2020, 21:49
x iJailBreak x's Avatar
x iJailBreak x x iJailBreak x is offline
 
Join Date: Jan 2011
Originally Posted by Dr.CustUmz View Post
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:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

But I cant get the catid to pull:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

This is the complete page in question, Just a simple confirmation page.

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

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:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.
Out of curiosity, if you var_dump($vbulletin->GPC); what does it return? And is it definitely present on var_dump($_REQUEST);?
__________________
Professional web developer & sysadmin. Former bad man.
Reply With Quote
  #3  
Old 29 Oct 2020, 22:49
Dr.CustUmz's Avatar
Dr.CustUmz Dr.CustUmz is online now
 
Join Date: Aug 2013
Real name: Ryan
var_dump($_REQUEST);

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

var_dump($vbulletin->GPC);

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

I am a bit baffled why there are references to products I have not installed on this fresh install, The only product I have installed is the product I am working on.

This is the portion in my page where the productid and catid are added, I have stripped a majority of this page but kept what should be relevant.


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

I guess I should be asking is, how is a GPC variable even created? Because I know I can use productid on numerous pages, although I am unable to use catid on these pages.
__________________
I have re-launched vBTeam! No longer will it be a warez site, but an alternative to here. Come Join Us Today!
I like to work with vB3, but if you have a custom request anything vB feel free to PM me!

Last edited by Dr.CustUmz; 29 Oct 2020 at 23:17.
Reply With Quote
  #4  
Old 30 Oct 2020, 14:28
x iJailBreak x's Avatar
x iJailBreak x x iJailBreak x is offline
 
Join Date: Jan 2011
Originally Posted by Dr.CustUmz View Post
var_dump($_REQUEST);

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

var_dump($vbulletin->GPC);

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

I am a bit baffled why there are references to products I have not installed on this fresh install, The only product I have installed is the product I am working on.

This is the portion in my page where the productid and catid are added, I have stripped a majority of this page but kept what should be relevant.


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

I guess I should be asking is, how is a GPC variable even created? Because I know I can use productid on numerous pages, although I am unable to use catid on these pages.
Interesting to note catid does not get passed even in $_REQUEST.. it definitely has a named field?

It'll only get registered in $vbulletin->GPC if it's first registered in $_REQUEST before your call to $vbulletin->input->clean_array_gpc();

In regards to it referencing plugins you don't have activated, I assume they are being passed in via $_COOKIE (which clean_gpc/clean_array_gpc will also run on).
__________________
Professional web developer & sysadmin. Former bad man.
Reply With Quote
Reply


Tags
gpc, variable


Currently Active Users Viewing This Thread: 2 (0 members and 2 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


New To Site? Need Help?

All times are GMT. The time now is 02:34.

Layout Options | Width: Wide Color: