Page going to after data inserted into database not in address bar
I have a page opening that before it loads it inserts info into a database, then upon the completion of the insertion takes my users to another page. However I want the page that it takes them to to show up in the address bar, but instead it shows the address of the page before they are redirected even though they are on the correct redirected page. How can I change this so it shows the accurate page url?