this is a custom script with the required phpM code added.
the currentuserid is lost when this executed… and also when a function within this script calls a function in userfn.php file… the id is not available --runs as anonymous
any way to get the id, or should i post it to a session variable
thanks,
Since it is your own .php, there is no current user ID before you log in the current user yourself. That’s why you should avoid standalone scripts, you may read Using Route_Action server event.
Best use the Custom Files feature to create a new php file, make sure to check the “Include common files” checkbox, then you can utilise the existing database connection and all global variables.
what we thought…
the script started out to be very simple/standalone… but… then…
Was able to work around as the records its processing has the userId needed, we
just added it to an array that was getting passed to the userfn.php function.