[SOLVED]PHP with button does not work

Hi there,

up to date SC6. I created some buttons with form to show in toolbar. As soon as I enter PHP Code with one button (echo “hello”:wink: I get this error with my application:

Parse error: syntax error, unexpected ‘{’, expecting ‘(’ in /myapp.php on line 2117

I want to use sc_confirm (“Do you really wish to execute this action??”); with my buttons, but PHP causes error.

Re: PHP with button does not work

I get the same error, when I don’t write any PHP code at all with button, but add 3 or 4 emty lines in PHP window. Everything deleted and form works.

Re: PHP with button does not work

@devs

can u confirm this bug? buttons are useless right now…

Re: PHP with button does not work

Hello Knuffiwuffi,

I use several buttons in my applications. I get no errors. Can you explain exactly what do you want to do?

Hans

Re: PHP with button does not work

Hello,

I did some more testing and I spotted the issue. I am not allowed to name the PHP button: {button}

I am only allowed to use text without {}.

This caused the problem and now it works fine. You could prohibit {} with button naming, maybe this will prevent issue for other SC users. Stupid me, but I did not come across this right away :wink: