Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 07-27-2006, 07:13 AM
rogersnm rogersnm is offline
 
Join Date: Apr 2006
Location: Cyberspace, UK
Posts: 729
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default 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?
Reply With Quote
  #2  
Old 07-27-2006, 07:19 AM
Mythotical Mythotical is offline
 
Join Date: Jun 2004
Location: Booneville, AR, USA
Posts: 1,428
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #3  
Old 07-27-2006, 07:29 AM
rogersnm rogersnm is offline
 
Join Date: Apr 2006
Location: Cyberspace, UK
Posts: 729
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #4  
Old 07-27-2006, 07:52 AM
FatalBreeze FatalBreeze is offline
 
Join Date: Apr 2004
Location: Haifa - Israel
Posts: 163
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #5  
Old 07-27-2006, 08:35 AM
rogersnm rogersnm is offline
 
Join Date: Apr 2006
Location: Cyberspace, UK
Posts: 729
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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...
Reply With Quote
  #6  
Old 07-27-2006, 08:41 AM
FatalBreeze FatalBreeze is offline
 
Join Date: Apr 2004
Location: Haifa - Israel
Posts: 163
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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)
Reply With Quote
  #7  
Old 07-27-2006, 08:42 AM
rogersnm rogersnm is offline
 
Join Date: Apr 2006
Location: Cyberspace, UK
Posts: 729
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

wohoo, thanks for that no it does work
Reply With Quote
Reply


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

Forum Jump


All times are GMT. The time now is 12:35 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.04237 seconds
  • Memory Usage 2,220KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (2)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (7)post_thanks_box
  • (7)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (7)post_thanks_postbit_info
  • (7)postbit
  • (7)postbit_onlinestatus
  • (7)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete