vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Post variable not working.. (https://vborg.vbsupport.ru/showthread.php?t=122275)

rogersnm 07-27-2006 07:13 AM

Post variable not working..
 
Ok, so here's my code:
PHP Code:

    $vbulletin->input->clean_array_gpc('p', array(
        
'id'             => TYPE_STR,  // i have tried TYPE_UNIT
    
));
    
    if (
$vbulletin->GPC['id'] AND is_numeric())
    {
        
$vbulletin->GPC['id'] = $vbulletin->GPC['id'];
    } else {
        
$vbulletin->GPC['id'] = 6;
        echo 
'not picked up';
    } 

when i type in: file.php?&id=6 for the adress it doesn't pick up the variable id - 6 - which it should it just sets it as 2 and echo's "not picked up"... Can anybody see what i am doing wrong?

Mythotical 07-27-2006 07:19 AM

You need to get rid of that echo and turn that into a die(mysql_error(not picked up))

echo will keep showing/repeating instead of actually doing what it should.

I could be wrong tho.

rogersnm 07-27-2006 07:29 AM

it's not an sql error...

and it doesn't change if i remove it or keep it. It's merely an echo. It shouldn't have any impact at all.

FatalBreeze 07-27-2006 07:52 AM

i had the same problem the last hack i built, but i managed to solve it finally. here's my code:

PHP Code:

$vbulletin->input->clean_array_gpc('r', array(
    
'userid'    => TYPE_STR,
    
'act'    => TYPE_STR,
));

$vbulletin->GPC['userid'] = intval($vbulletin->GPC['userid']);
$vbulletin->GPC['act'] = intval($vbulletin->GPC['act']); 

and now it should work, i used type_str for the id cause that's the only one that worked...
i hope it will also work for you and you won't have a problem. all you have to do now is the "if" part.

rogersnm 07-27-2006 08:35 AM

which is i have already done

thanks, i just have to change UNIT to STR

nope, still not picking it up...

hmm, if i take out the if it works.... it seems to be that the else dominates when it shouldn't...

FatalBreeze 07-27-2006 08:41 AM

try change
$vbulletin->input->clean_array_gpc('p', array(
to:
$vbulletin->input->clean_array_gpc('r', array(

(notice the 'p' replaced by the 'r' - i gave it to your in the first post but you didn't notice it)

rogersnm 07-27-2006 08:42 AM

wohoo, thanks for that no it does work :)


All times are GMT. The time now is 05:02 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01640 seconds
  • Memory Usage 1,726KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (7)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete