Regarding your second error message:
Header information is sent to the browser as soon as the page starts being processed. When you are going to use redirection, which is what you effectively are doing, you need to buffer the header output until you are ready to send it.
You do this by having:
- Code: Select all
ob_start();
at the very begining of the page and once you have got to the end of your
php processing, make the last command;
- Code: Select all
ob_end_flush;