The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
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 |
#2
|
||||
|
||||
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.
|
#3
|
|||
|
|||
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 |
#4
|
|||
|
|||
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.)
|
#5
|
|||
|
|||
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. |
#6
|
|||
|
|||
Why not just create a single selection drop of browsers?
|
#7
|
|||
|
|||
than user gives false information, which i tried already
|
#8
|
||||
|
||||
UA headers are not hard to fake either, you know...
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|