Prevent resubmit form after click “back” button

前端 未结 6 1838
情歌与酒
情歌与酒 2020-12-09 06:57

I have 2 pages :

page1.php :
- has a form with text box and a \"submit\" button. Eg :

6条回答
  •  暖寄归人
    2020-12-09 07:44

    Rather than

    echo '';

    you should use the header() function to redirect your user after the submission.

    So in psuedo code,

    click submit on page.php action page1.php page1.php submits data to database calls

    header('Location: http://example.com/page2.php');
    

    This should prevent your clicking back problem

提交回复
热议问题