Welcome to the nuBuilder Forums!

Register and log in to access exclusive forums and content available only to registered users.

Create a Hash Cookie Through Concatenation?

Questions related to customising nuBuilder Forte with JavaScript or PHP.
Post Reply
pmjd
Posts: 132
Joined: Fri Mar 12, 2021 10:38 am
Has thanked: 3 times
Been thanked: 1 time

Create a Hash Cookie Through Concatenation?

Unread post by pmjd »

In a procedure is it possible to concatenate a hash cookie value with other text to create another hash cookie name?

I have a common field on all my table for the lot number of a product,

Code: Select all

xxx_lot_number
, where xxx is the lowercase three letter prefix for each table.

Is there a way to concatenate the "#form_code#" hash cookie to the text _lot_number to create the hash cookie xxx_lot_number?

So far I've tried

Code: Select all

	$lot = "#form_code#"."lot_number";
and

Code: Select all

$lot = "#form_code#".'_lot_number';
which output psn_lot_number in text rather than the value.

Tried to concatenate the " and # at either side with

Code: Select all

$lot = '"#'.'#form_code#'.'_lot_number#"';
which outputs "#PSN_lot_number#"

Is this possible to create a functional hash cookie this way?
kev1n
nuBuilder Team
Posts: 4299
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 71 times
Been thanked: 445 times
Contact:

Re: Create a Hash Cookie Through Concatenation?

Unread post by kev1n »

Try:

Code: Select all

$lot = nuReplaceHashVariables("#". "#form_code#" . "_lot_number". "#");
pmjd
Posts: 132
Joined: Fri Mar 12, 2021 10:38 am
Has thanked: 3 times
Been thanked: 1 time

Re: Create a Hash Cookie Through Concatenation?

Unread post by pmjd »

Works like a charm. thank you kev1n
Post Reply