dannyd Posted March 31, 2008 Share Posted March 31, 2008 I have a script that add/updates/deletes values in a database. After the sql takes place I'd like to redirect them to a page. When I do this I get the error below: Warning: Cannot modify header information - headers already sent by (output started at /admin/attributes.php:4) in... Is there a way to redirect without getting this error ? Quote Link to comment Share on other sites More sharing options...
metrostars Posted March 31, 2008 Share Posted March 31, 2008 It means that you have echoed some text to the page before you wanted to redirect. Make sure that you put the header before the headers of the page. Quote Link to comment Share on other sites More sharing options...
dannyd Posted March 31, 2008 Author Share Posted March 31, 2008 The pages are really case statements. I'd like to redirect to the default case kind like below: header (location: attributes.php?action=default); Quote Link to comment Share on other sites More sharing options...
xnowandtheworldx Posted March 31, 2008 Share Posted March 31, 2008 Yeah, if you have any html, or anything echoed before the actual header() function it won't work. So just make sure nothing is being outputted before hand. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.