Static Security - passing a value around

This public forum is for user-to-user discussions of PHPMaker. Note that this is not support forum.
Post Reply
johnberman
User
Posts: 210

Static Security - passing a value around

Post by johnberman »

Hi

I have three tables

meteor_events (has Event_ID and other fields)
Contributor (has name, email, password, contributor_ID etc)
Comments (has Event_ID which is the link to meteor_events, contributor_ID and other fields)

All 3 have a common link that is contributor ID

I dont allow registration as I add contributors

using Static levels a user can login and add comments which is great

I assume somehow I can get the contributor ID passed to the contributor ID field automatically in comments so it can be seen who added comments

Im sure its a setting somewhere ?

Regards
John Berman


mobhar
User
Posts: 11721

Post by mobhar »

$this->contributor_ID->DbValue


arbei
User
Posts: 9382

Post by arbei »

If the contributor table is the User Table, you can use CurrentUserInfo("contributor_ID") to get the id of the logged in user.

Add this function as the Default Value of the Add page of the Comments table then generate the files and try again.

Read help file topic: "Server Events and Client Scripts" -> "Some Global Functions" for more information.


Post Reply