This topic is locked
[SOLVED]

 Show Userid On List/view Pages According To Session

3/3/2013 4:55:55 AM
PHPRunner General questions
N
nimda author

Hi,
i have a database table products with these fields: id, countproductid, productname and analyst. What i want to accomplish is that when ever someone edits/adds new data to the database to add the userID of the currently logged in username. I do this:

// Process record values

function ProcessValuesEdit(&$values)

{
$values['analyst'] = " " . $_SESSION['UserID'];
;

} // function ProcessValuesEdit


The above code works well on add/edit page(s) and shows the needed data. But when this user logs out and re logs in or any other user logs in the system the field gets empty.

Any suggestions?
Thanks.

Sergey Kornilov admin 3/3/2013

$_SESSION['UserID'] is always populated with the current user login name. Re-login or another user login doesn't change anything. I guess you are dealing with something else.
If you need more help post your application to Demo Account and open a ticket at http://support.xlinesoft.com sending your Demo Account URL. 'Demo Account' button can be found on the last screen in the program.

N
nimda author 3/4/2013



$_SESSION['UserID'] is always populated with the current user login name. Re-login or another user login doesn't change anything. I guess you are dealing with something else.
If you need more help post your application to Demo Account and open a ticket at http://support.xlinesoft.com sending your Demo Account URL. 'Demo Account' button can be found on the last screen in the program.


Yeah i suggested that. Is it possible to do this permanently? Meaning to get the username from the user that works on the system currently and save it in the corresponding table?
Thanks.

Sergey Kornilov admin 3/4/2013

Your question doesn't make much sense to me. It already works this way.
There might be something related to your version of PHPRunner or to your project configuration. Impossible to tell without seeing your project files.

N
nimda author 3/5/2013



Your question doesn't make much sense to me. It already works this way.
There might be something related to your version of PHPRunner or to your project configuration. Impossible to tell without seeing your project files.


You said that the script i asked for will always take the session of the userid that is everytime logged in. But i need to store this in the database (and when someone else changes the data to update) that's why i asked for any help.
Currently i can't pass any project details.
Thanks.