coppermine-gallery.com/forum

Support => cpg1.5.x Support => cpg1.5 miscellaneous => Topic started by: Schryvers on November 15, 2012, 02:02:34 AM

Title: Question User_name function
Post by: Schryvers on November 15, 2012, 02:02:34 AM
I have an Email form,

And i want the Username of the logged in person inserts automatically in the hidden input field.

So what i did:

On the page where the mailform is, i include Functions.inc.php

And the value of the hidden input is set on <? echo= $user_name ?>

Then, nothing gets there when i check it.

What i need to do?
Title: Re: Question User_name function
Post by: Jeff Bailey on November 16, 2012, 02:39:12 AM
Please post the code that you have.
Title: Re: Question User_name function
Post by: ΑndrĂ© on November 20, 2012, 10:58:50 AM
You don't need to include include/functions.inc.php, it's always included. However, the variable $user_name doesn't exist as you already noticed.

Instead, use $USER_DATA['user_name']. If that also doesn't work, add
global $USER_DATA;
somewhere above.
Title: Re: Question User_name function
Post by: GGFix on December 30, 2012, 07:27:20 PM
This is a useless thread since the code was excluded and is of no help to anyone???

Might have actually been of help to others ???
Title: Re: Question User_name function
Post by: ΑndrĂ© on January 02, 2013, 01:19:06 PM
There hasn't been excluded anything from the thread. However, I think my post explains exactly how to get the current user's name.