D
D
Daniel2017-02-25 15:06:40
Browsers
Daniel, 2017-02-25 15:06:40

How to remove re-sending a POST request?

Good to everyone!
Usually, when submitting a form and then reloading the page, the browser prompts you to submit the form again.
I have a search form on one page. The data is output and processed on another. When you reload or return to the data page, the browser prompts you to resubmit the form. Can this be bypassed somehow?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Vitaliy Orlov, 2017-02-25
@orlov0562

yes, you can, after submitting the form, redirect the user to the page url:

<?php
    if (!empty($_POST)) {
        // ......
       header('location:?');
    }
?>
<form method="post">
<input type="submit" name="submit">
</form>

S
SimBioT19, 2017-02-25
@SimBioT19

Send asynchronous requests or do a redirect

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question