This topic is locked

if (!$inline) $values["FIELD"] = encrypt($v

6/11/2011 12:34:01 PM
PHPRunner General questions
N
nti author

If we have multiple fields for encryption... what is proper code for utlizing 'if (!$inline)'
I thought I had this functioning OK, with the following code:



if (!$inline)

$values["FIELD1"] = encrypt($values["FIELD1"]);

$values["FIELD2"] = encrypt($values["FIELD2"]);


HOWEVER the first field is OK and the second "FIELD2" is deleted if doing inline edit on third field.
MY QUESTION: what is proper code for utlizing 'if (!$inline)' with multiple fields?



if (!$inline)

$values["FIELD1"] = encrypt($values["FIELD1"]);

$values["FIELD2"] = encrypt($values["FIELD2"]);

$values["FIELD3"] = encrypt($values["FIELD3"]);


OR



if (!$inline)

$values["FIELD1"] = encrypt($values["FIELD1"]);
if (!$inline)

$values["FIELD2"] = encrypt($values["FIELD2"]);
if (!$inline)

$values["FIELD3"] = encrypt($values["FIELD3"]);


OR is it another method?
All feedback is welcomed.

D
Dale 6/11/2011

[quote name='nti' date='11 June 2011 - 09:34 AM' timestamp='1307810041' post='58812']

If we have multiple fields for encryption... what is proper code for utlizing 'if (!$inline)'
I thought I had this functioning OK, with the following code:



if (!$inline)

$values["FIELD1"] = encrypt($values["FIELD1"]);

$values["FIELD2"] = encrypt($values["FIELD2"]);


Try
if (!$inline)

{

$values["FIELD1"] = encrypt($values["FIELD1"]);

$values["FIELD2"] = encrypt($values["FIELD2"]);

}