SyntaxError: Unexpected token D in JSON at position 0 - Form Submit (onAfterProcess)

tiagovareta

Member
Hi,

I have a form, to register orders and are trying to put the payment by ATM.
In this form I have 2 plugins: PHP + Redirect,
The PHP Plugin (onAfterProcess) Calls the file: include 'plugins/fabrik_form/php/scripts/pay/register.php' - Where it generates the payment references and writes them (update), of the record that has just been inserted. This part is working.

In the Plugin Redirect, go to the page: http://dominio.pt/agradecimento/?idenc={ndxpg_lp_encomendas___id} - Where I have a page of thanks, that will consult the data of the encomenda and makes a brief summary. This part is working (if you access directly, without going through the form).

What is not working is that when submitting the form, it gives the error: "SyntaxError: Unexpected token D in JSON at position 0"

That is, it records the order and payment data, but does not redirect it to the thank you page.

Can anyone help me in this situation?
 
You get the text "Details for payment..." echoed? returned? at a point where a JSON response is expected (so throwing unexpected token "D"...)
 
You get the text "Details for payment..." echoed? returned? at a point where a JSON response is expected (so throwing unexpected token "D"...)

Hi Troester,

I ended up removing the lines where I had the "echo" and apparently it is working.

Thanks for the tip!
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top