You are echo
ing before your redirect. You see server sends all information to client browser once; so don't send anything before you modify headers
or don't modify headers after you send something.
What you need do, is rethink login of your PHP code and rewrite it, with context to what I said above.
Anyway, that's a warning message; get rid of it by
ini_set(display_errors, '0'); Or use buffering
ob_start(); at top and
ob_end_flush(); at bottom ( this way server will buffer all o/p and then send it, at last once ).
http://www.mediasworks.com/tutorial/
http://scholarship.mediasworks.com/
Regards.