How to avoid resending data on refresh in php

Posted by Priyanka on Stack Overflow See other posts from Stack Overflow or by Priyanka
Published on 2010-04-19T11:15:17Z Indexed on 2010/04/19 11:23 UTC
Read the original article Hit count: 166

Filed under:

Hello.I have a page "index.php" where i have a link called "add_users.php".In "add_users.php",i accept user information and come back to the same page "index.php" where information comes through post action and gets inserted into the database.When i refresh the page orhit back button,resend box appears.I went through many solution where they asked me to create third page.I tried doing that as follows:After inserting values in database,I redirected ht page as header('Location:http://mysite.com/thankyou.php, and in thankyou.php I again redirected the page to index.php.But getting warning as Cannot modify header information - headers already sent by.... provide me a better solution. Thank You in advance.

© Stack Overflow or respective owner

Related posts about php