Join our community by registering and logging in.
As a member, you'll get access to exclusive forums, resources, and content available only to registered users.
I have recently wanted to use some custom parameters passed via the login URL. I propose storing these as a PHP session variable which is created when the $_GET array is parsed in index.php. My request then is to add these three lines near line 229 in index.php (after the built-in Auto Login parameters have been assigned to variables). In my example, the password parameter would be removed from the stored array.
$nuHome = $_GET['h'] ?? '';
// store the parameters for the duration of the session
$URLParams = $_GET;
unset($URLParams['p']); // remove the password from the array
$_SESSION['nubuilder_session_data']['URL_PARAMS'] = $URLParams;
// end of parameter storage insert
I realise that there are methods in both JavaScript and PHP to achieve this, but a little experimentation has convinced me this would be the simplest and most reliable solution.
The code within index.php can also be executed at a later time, such as when an iframe is loaded. Therefore, it would be prudent to conditionally set the URL_PARAMS only if they have not been defined already. Failing to do so could lead to potential difficulties in retrieving them later.