![]() |
How Can I insert the username of who submitted a form to the database?
Hello everyone, I am trying to capture the username of whoever submits a custom form I created. I need to insert that username of who submits the form into a database table I created. I need this to first have a record of who submitted the form and also to later print out the username next to the form submitted, as well as restrict later access to that form using if conditions, but first I need to get that username. Any one has any ideas how to go about this or point me in the right direction?? Please any information would be very useful. Thank you for your time everyone. :)
|
I think the username should be available in $vbulletin->userinfo['username'].
|
Right but how does the form know that? Should I just insert that while I'm inserting the form values? I don't get how that knows that that form was submitted by that user. Anyone can explain please??
This is my form: HTML Code:
{vb:stylevar htmldoctype} PHP Code:
|
When you include global.php, it does a lot of stuff for you like makes sure the user is logged in (actually you have to check that - if the user id is '0' then the user is an unregistered guest). So hopefully the answer to your question is that it should all be handled by including global.php.
(If this doesn't answer your question I'll let someone else try :) ) |
PHP Code:
|
P E R F E C T !! I knew it had to be something simple :) Thank you SOO much Disasterpiece, hopefully you'll be seeing my first mod up here soon enough? Thanks to everyone's help, it's really easy to learn anything when you have this level of support. Thanks guys. :)
|
All times are GMT. The time now is 01:17 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 | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|