This topic is locked
[SOLVED]

 Capture the User Login Name on Add

4/30/2009 16:05:02
PHPRunner General questions
lewisgr author

I'm so new... well anyways, I have a field AddedBy and I want the webpage to capture the logged in Users name. I saw this:
"user=".SESSION["TableID"]
but it didn't work <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=question&id=11713&image=1&table=forumtopics' class='bbc_emoticon' alt=':blink:' />

vin7102 5/1/2009

lewisgr,
Hello and welcome to the forums,
This is what I usually do if i only want the logged in users name to be used in the record:

  1. in the add page, double click your user name field and and in the "Edit as" tab, select "Read only".
    2.In the "Default Value" text box, enter the following and replace "field name" with the name of the field you are working with.
    $values["field name"]=$_SESSION["UserID"];



And thats it!
Regards,

lewisgr author 5/1/2009

lewisgr,

Hello and welcome to the forums,
This is what I usually do if i only want the logged in users name to be used in the record:

  1. in the add page, double click your user name field and and in the "Edit as" tab, select "Read only".
    2.In the "Default Value" text box, enter the following and replace "field name" with the name of the field you are working with.
    And thats it!
    Regards,


Thank you very much! It worked! <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=40690&image=1&table=forumreplies' class='bbc_emoticon' alt=':)' />