On my website I use PHP files for all sorts of things, friending people, creating accounts, and more. I will have a PHP file like so:
<?php
/*Does some sort of action to stored data on the server*/
header('location: mysite.org');
?>
The issue is that the it goes to mysite.org before the rest of the PHP is actually updated. This causes problems because if a user, for example, posts a message, it won't appear right away, only after 1 or 2 refreshes it will. How could I fix this? I am accessing these PHP files with HTML forms sending a POST request.