Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
  #1  
Old 12-26-2008, 09:49 PM
emucu emucu is offline
 
Join Date: Dec 2005
Posts: 18
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Need help for saving a variable result to db

Hello,

I want to save specific information of visitor , for example browser info, while user is registered. So instead of asking to user i can get user's browser info with a variable like $browserinfo, by another method.

So here is the main question, how can i store result of $browserinfo to database?

So its basicly like a profilefield, user choose an option or write and its stored at user table. You can print it using $post[fieldx] code.

I was planning to do it using profilefield but couldnt manage to do it.

So finally, when you register (when registration form loads) using that code it will determine your browser name, and it will save browser name to database
Reply With Quote
  #2  
Old 12-26-2008, 10:02 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

It's unclear to me whether you are asking the user to set this field or whether you are going to write code to determine this field. If you are going to ask the user, then just use a profile field (you said you tried, but couldn't, so tell us exactly what you did and what the result was), if you are going to write some code to do it, one way would be to create a new column in the user table, add that column into the validfields for the user datamanager (class_dm_user.php), and then use the datamanager to save the information for you upon registration.
Reply With Quote
  #3  
Old 12-26-2008, 10:18 PM
emucu emucu is offline
 
Join Date: Dec 2005
Posts: 18
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Sorry for not being clear, i just want to save result of $browserinfo variable to database thats the main question.

But dont know how to do it ?

Instead of making that much effort, , i think i can create a fake profilefield so i can directly put result in that table

so example is , result of $browserinfo will be stored in userfield table field8 coloumn for each user when they register

I am a total noob about php so i can't get it so easily
Reply With Quote
  #4  
Old 12-26-2008, 10:33 PM
Guest190829
Guest
 
Posts: n/a
Default

What went wrong when trying to use a custom profile field? That seems like the easiest solution (but it will only be updated when the user decides to update it.)
Reply With Quote
  #5  
Old 12-26-2008, 10:41 PM
emucu emucu is offline
 
Join Date: Dec 2005
Posts: 18
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

The point is,

When i create a single line text field and put $browserinfo as default value, it shows it as $browserinfo instead of result of variable, for example Internet Explorer. Not sure if there is any coding problem or if it is because i can't put $browserinfo in profile field because it is php.
Reply With Quote
  #6  
Old 12-26-2008, 10:51 PM
Guest190829
Guest
 
Posts: n/a
Default

Why not just create a single selection drop of browsers?
Reply With Quote
  #7  
Old 12-26-2008, 10:54 PM
emucu emucu is offline
 
Join Date: Dec 2005
Posts: 18
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

than user gives false information, which i tried already
Reply With Quote
  #8  
Old 12-27-2008, 03:20 AM
Dismounted's Avatar
Dismounted Dismounted is offline
 
Join Date: Jun 2005
Location: Melbourne, Australia
Posts: 15,047
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

UA headers are not hard to fake either, you know...
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:25 AM.


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.07200 seconds
  • Memory Usage 2,216KB
  • 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)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (8)post_thanks_box
  • (8)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (8)post_thanks_postbit_info
  • (8)postbit
  • (6)postbit_onlinestatus
  • (8)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