Form -> PHP script inside code bric, not working

I made a page with a form.

The submit button interaction is set to “submit form”.

The form setting are:
type - “custom”
action - the complete URL including https://
method - “post”

The correct page (also on the same website, made with blocs) is called and appears, but it seems the php is not executed, because it doesn’t even do a simple “echo” command, which it does when tested locally.

The PHP code is in a code widget on the called page.

What am I doing wrong here?

Hello @yodazhang, probably “Lazy load” is active when you export, try disable that option when you export the website and let us know. About the action if is in the same domain you can only call the page ./phpformblablabla.php

Lazy load is not active.

The call works (but I had to add another . so it’s …/nameofpage
(two . seemingly get replaced by three . here in the forum? it’s actually two)

Page type is set to php.

But the script still doesn’t execute. Is it ok to be in a code bric?

I really need help with this. Can’t continue with my business as long as it’s not working.

The best way to find error is if you share that part of your project so we can check…

There’s no error in the code or something. The PHP as a seperate file works. The PHP inside the code bric also works when I test in browser. The form page also sends the data, since it works when it call the PHP in the seperate file. Only when the form page calls the page with the PHP, the PHP simply doesn’t get executed.

Is there a possibility that Brics removed the content of the code-bric on export?

Sometimes, what happen and probably could be your case, there are some bugs when you use the code-bric with preview activated. When you copy paste code with preview activated sometimes it change code, other times it do it when you export the page.

So try to disable the preview option in the code bric, then delete all the content. Then close the code bric, open it again and paste content with the preview disabled. And try…

In a different occasion the issue I have in code bric was about the < or > symbol it changes when I export … so I have to use it with code not plain symbol.

Check is some of this situations is happening…