variable for the username variable for the username
 

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

variable for the username

Started by h3lium, January 14, 2005, 06:45:16 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

h3lium

hello,
first of all sorry for my english ;-) i'm a german, but i try to do my best...

im currently working on a guestbook for my gallery.
everything is working, exept of one thing, the user have to enter their names manually.
thats what i want to change.
but i dont know how to get the username.
does somebody know how to handle that?
i just need to set the current variable ($name - which the user have to fill in by a form) to the variable of the gallery...

it would be very cool if somebody could help me, cuz spend many hours for this allready :)

greeting
christian

Joachim Müller

this has been asked only recently - search the forum (for "guestbook").

Joachim

h3lium

sorry, i allready searched, and tried it again now, but i didnt found anything that could match...
thats also why i registered :) , usually i try to find anything befor i register...

in SMF (simply machines forum) its just a simple thing. like "$context['user']['name']"
and thats it...
is there nothing like this in coopermine?

Nibbler

If you can include init.inc.php then you have USER_NAME available. If you can't include it then you can use the authentication mod to give you the same.

h3lium

i included it...
- require('include/init.inc.php');

and i'm using "$user['user_name']" but that doesn't work ...
i dont know why :(

Nibbler

Because there is no such variable! - that's why I said to use USER_NAME :)

h3lium

that doesnt work too :(
i donna why...


here is a small part of the code:

...
    <tr>
     <td><b>';
echo 'Name:';
     echo'</b></td>
     <td>';
echo $USER_NAME;
echo'</td>
    </tr>
    <tr>
...


require('include/init.inc.php');


Nibbler

I don't understand why you refuse to use USER_NAME

<?
define('IN_COPPERMINE', 1);
include 'include/init.inc.php';
echo USER_NAME;
?>

h3lium

uff...
now its working... :) thanks alot!!!
you really helped me!
problem is solved :)

greetings
chris

Joachim Müller