vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   vb3: New Profile Fields = Nothing Sent to UPDATE in query. [solved] (https://vborg.vbsupport.ru/showthread.php?t=61299)

Harlequin 02-07-2004 10:27 PM

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. :)

g-force2k2 02-07-2004 10:36 PM

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

Harlequin 02-11-2004 06:39 PM

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.

Andreas 02-11-2004 06:46 PM

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.

Harlequin 02-11-2004 06:48 PM

Thanks for the tip. :)


All times are GMT. The time now is 08:43 AM.

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.01009 seconds
  • Memory Usage 1,724KB
  • 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
  • (1)bbcode_html_printable
  • (3)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (5)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