News:

Wondering if this will always be free?  See why free is better.

Main Menu

Using SMF member_id in a form

Started by blockus, February 26, 2012, 03:00:29 PM

Previous topic - Next topic

blockus

I'm using SMF 2.0 and I'd like for the member_id of the person logged on to automatically be inserted into a form I'm creating outside of the forum when the form is submitted. For example, in the case of a feedback form, the user fills out a "comments" field online and clicks submit. When I look in my database table, I'd see the comment, and the member_id of who submitted the feedback.

I'm creating the form in dreamweaver cs4.  I know that I have to add a hidden field for the member_id, I just don't know how to get the member_id to be automatically inserted.  Any ideas?

Thanks everyone,

-CB

IchBin™

<input type="hidden" name="id_member" value="' . $context['user']['id'] . '" />

Make sure you have $context in the global scope of your page/function.
IchBin™        TinyPortal

Advertisement: