Page 1 of 1

Create a Hash Cookie Through Concatenation?

Posted: Tue Oct 26, 2021 4:00 pm
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?

Re: Create a Hash Cookie Through Concatenation?

Posted: Tue Oct 26, 2021 4:10 pm
by kev1n
Try:

Code: Select all

$lot = nuReplaceHashVariables("#". "#form_code#" . "_lot_number". "#");

Re: Create a Hash Cookie Through Concatenation?

Posted: Tue Oct 26, 2021 4:16 pm
by pmjd
Works like a charm. thank you kev1n