Warning: Cannot modify header information - headers already sent by (output started at C:\xampp\htdocs\I\edit.php:7) in C:\xampp\htdocs\I\edit.php on line 39
If you are outputting the form to the browser and then calling the header function, it will cause an error because you can’t have any output or whitespace before the header function. It might be possible to rewrite your code to fix this but if you can’t, then the other option is to use the HTML meta refresh tag to load the page instead of using header.
If it’s not possible to reorganise your code so that the header function appears before any output then another option is to echo out the javascript to use window.location.href=‘someURL’ to redirect to another page instead of header.
If you have to cater for the most likely relatively tiny number of javascript disabled browsers then the above option would not work in them.