Question User_name function Question User_name function
 

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Main Menu

Question User_name function

Started by Schryvers, November 15, 2012, 02:02:34 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Schryvers

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?

Jeff Bailey

Thinking is the hardest work there is, which is probably the reason why so few engage in it. - Henry Ford

Αndré

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.

GGFix

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 ???

Αndré

There hasn't been excluded anything from the thread. However, I think my post explains exactly how to get the current user's name.