Question User_name function Question User_name function
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

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.