I want to know if it's possible to show ajax progress with messages from php script ?
For exemple, my backend.php got 3 steps. When I click on my button, I want :
- to display: 'loading step 1'
- when my backend.php move forward to step 2, display : 'loading step 2'
- when my bakcend.php move forward to step 3, display : 'loading step 3'
Currently I only manage to do something like this with multiple ajax call, when ajax 1 is done, my alert change and I launch ajax 2....
I guess there is maybe a better way to do this ?
Thank for your help.
I finally manage to do something that works ok with me.
I use server sent event (SSE) to get messages from server when I change step or get error.
Since I use only one file for the server part, I manage to use sql transaction.
And to use post data from my from, I use ajax, store these datas inside php session. If ajax return success, then I launch SSE, otherwise I stop everything.