I have html page where you can insert some information and then submit this form, which will change information in database. I do it normally, that submit button call php file in server.
But what I want, is that this php file will return to me the same html page of which I sent request, with modified changes. e.g: there will be “Database update successfully” text added etc.
How can I do it without AJAX ?
Thanks
In the PHP file, do a call to the header() function to redirect the user. For example:
To change the content of that page they are redirected to, you could pass something in the URL that your page will check for. For example:
There are other ways to implement this, but this seems the most straightforward to me. Note that you don’t want to call header() until the end of your submission page.