This topic is locked

Username in main table

7/22/2008 9:43:20 AM
PHPRunner General questions
Z
zeitsprung author

Hi,

currently I use a drop down select from a lookup table (tablename_users) to let the person in charge chose its own name...

This can mislead since another username can intentionally or accidently be selected. It would be much more elegant, if this field (official in charge, 'tablename_oic') could be filled automagically with the name of the person who is logged in. This has to be done in add and edit mode respectively.

A solution for this would be highly appreciated <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=question&id=9059&image=1&table=forumtopics' class='bbc_emoticon' alt=':)' />

Thanks.

T
thesofa 7/22/2008

Hi,

currently I use a drop down select from a lookup table (tablename_users) to let the person in charge chose its own name...

This can mislead since another username can intentionally or accidently be selected. It would be much more elegant, if this field (official in charge, 'tablename_oic') could be filled automagically with the name of the person who is logged in. This has to be done in add and edit mode respectively.

A solution for this would be highly appreciated <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=31297&image=1&table=forumreplies' class='bbc_emoticon' alt=':)' />

Thanks.



Hi

The logged in user is stored in the system variables, and you can set the field `official in charge` to be read only with a default value of the systemvariable that is used to store the name, or the ID of the user.

Go to the help file in PHPR, select advanced topics then chose the PHPR session variables, where you will find the variable you need.

It is probably $_SESSION["UserID"]