form? Using Ajax I can read the error in the response, but with the form I can't 'cause the page is getting refreshed to each submit, what do you suggest?
Do you want to avoid to refresh the page when you push submit button?
Nope, I just want to know how can I debug a submitted form when the associated php file raise an error. How can I get the error generated by the called PHP file? Using Ajax I can see this error, but with the form I can't because the page is refreshing
Ok, you need to manage your error server side. If the error raised server-side thats the "side" that you need to debug.
Mmm I'm using codeigniter 4, to check the error I can log the $_POST variable in a file, but there is a simple way to know the error description?
The problem happens when you try to do some crud operation? if so you need to wrap that operation in a try/catch https://www.php.net/manual/en/language.exceptions.php
You can use var_dump() to debug and die() to stop php execution so that it won't refresh. And make sure no js script is forcing browser to reload
Обсуждают сегодня