Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
  #1  
Old 02-07-2004, 10:27 PM
Harlequin's Avatar
Harlequin Harlequin is offline
 
Join Date: Aug 2003
Posts: 78
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default vb3: New Profile Fields = Nothing Sent to UPDATE in query. [solved]

In vb2, everything in the config file I'd written read and saved fine. However, with vb3, there's a whole new world of hurt with how vb3 reads and saves it's <form> information. [in the profile, specificly.]

Simply put, the form doesn't save anything. I've figured out all of the redirecting stuff in profile.php and the seperate config file I've written (I upgraded it to the request and post stuff vb3 requires, as well as the template output and redirection..)

But nothing saves.

I've even put a 1 in the query just to mess it up so I can actually verify that nothing was being transferred from the form to the query save.. and sure enough, nothing was being passed into the variables.

Am I correct in assuming that globalize now works the way forms transmit their data into the query to save? If that's the case, how does globalize need to be typed up for example?

Am I missing any other big points on how to transfer this information?


Just curious.
Reply With Quote
  #2  
Old 02-07-2004, 10:36 PM
g-force2k2 g-force2k2 is offline
 
Join Date: Mar 2002
Location: Everywhere you wanna be..
Posts: 1,608
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I believe that the globalizing is done in the init.php and adds the variable to the $_POST array, to add variables you have to sue the globalize function. for example:

PHP Code:
globalize $_POST, array ( 'variable1''variable2' ) ) ; 
Hope that helps,

Cheers,
g-force2k2
Reply With Quote
  #3  
Old 02-11-2004, 06:39 PM
Harlequin's Avatar
Harlequin Harlequin is offline
 
Join Date: Aug 2003
Posts: 78
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks g-force! Again and again.

For anyone else new to coding in vb3 with this or curious, in the following statement:

PHP Code:
if ($_POST['do']=="NAMEOFPOSTIF")
// do is the action being sent here, NAMEOFPOSTIF is do's command 
Place this at the top:

PHP Code:

// replace LETTERS with any character string being sent to write/update.
// replace NUMBERS with any numeric string being sent to write/update.
globalize($_POST, array('LETTERS' => STR'NUMBERS' => INT)); 
To add more than just one or two fields to write, just continue with STRs or INTs with commas after each.. until the last one of course.

Also note in your templates that to process your form, an extra <input> in the form must be something like:

HTML Code:
<input type="hidden" name="do" value="NAMEOFPOSTIF">

Hope this helps any new coders.
Reply With Quote
  #4  
Old 02-11-2004, 06:46 PM
Andreas's Avatar
Andreas Andreas is offline
 
Join Date: Jan 2004
Location: Germany
Posts: 6,863
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

For security-reasons it's generally not a good idea to globalize all variables at the top ,otherwise we could just leave register_globals on .

Use globalize carefully only at places where you really need it (eg. in your $_REQUEST['do'] = 'foobar' {}), and only for those variables you are going to process.
Reply With Quote
  #5  
Old 02-11-2004, 06:48 PM
Harlequin's Avatar
Harlequin Harlequin is offline
 
Join Date: Aug 2003
Posts: 78
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks for the tip.
Reply With Quote
Reply

Thread Tools
Display Modes

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 04:29 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.03634 seconds
  • Memory Usage 2,203KB
  • Queries Executed 13 (?)
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
  • (1)bbcode_html
  • (3)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (5)post_thanks_box
  • (5)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (5)post_thanks_postbit_info
  • (5)postbit
  • (5)postbit_onlinestatus
  • (5)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_postinfo_query
  • fetch_postinfo
  • 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