Parse error: syntax error, unexpected '['

on control_login I have global variable

sc_set_global ($sm_global_login];

if I use blank form to echo this variable

echo [$sm_global_login];

following error occurs

Parse error: syntax error, unexpected ‘[’

same error happens if I set one of form fields to use this variable

{loginid} = [$sm_global_login];

note : this happened after updating scriptcase.

advice !

best

Re: Parse error: syntax error, unexpected ‘[’

sc_set_global ($sm_global_login]; <<— delimiters do not match??

You have to keep in mind PHP sees [] as an array, SC is trying to use this as a macro. Try spacing things [ var ] instead of [var]

Also, you are using variable inside a SC macro … should it be [ var ] and not [ $var ]

Regards,
Scott.

Re: Parse error: syntax error, unexpected ‘[’

Hi Scott;

same error even with

{txtownerid} = [ sm_global_login ];

please advise.

Re: Parse error: syntax error, unexpected ‘[’

My suggestion, use session variables and do not use sc_global. I have always had problems with sc_global vars getting lost or not working as expected.

http://www.scriptcase.net/forum_en_us/index.php?topic=1723.msg5493#msg5493
http://www.scriptcase.net/forum_en_us/index.php?topic=1504.msg4690#msg4690

[] {} are not good macro delimiters IMHO, use PHP defaults.

Regards,
Scott.