if l wll be you, l will use a javascript.
define something like
$ready=;
then use javascript code and refer the $ready in the javascript.
It is very easy. If you can not handle it, let me know and l will post you a full written java script code!
However, your warning seems like you have two
if(isset($_POST['xxxx'])) {
header("Location: url");
if this is the case, do well to delete one since the error message is telling you that, the header has already sent a location and you are trying to overwrite on the older one....
check the line 319 of the user_mnager.php and the line 15 of the index.php. There is a conflict......>the index.php header you are trying to write has already been sent by the user_manager.php. And l bet you have included one of them in the other.
Best Regards