alexcrosson Posted October 3, 2006 Share Posted October 3, 2006 This is the error I get:[b]Warning: Cannot modify header information - headers already sent by (output started at /home/totallyc/public_html/login/users.php:18) in /home/totallyc/public_html/login/add_user.php on line 16[/b]Here is my code starting at line 16:[code]header("Location: users.php");[/code]I need to redirect after a user has been added and i'm having trouble doing it. Quote Link to comment https://forums.phpfreaks.com/topic/22868-warning-cannot-modify-header/ Share on other sites More sharing options...
ToonMariner Posted October 3, 2006 Share Posted October 3, 2006 you have output some html or whitespace before that line of code gets executed....headers must be sent before you do that. Quote Link to comment https://forums.phpfreaks.com/topic/22868-warning-cannot-modify-header/#findComment-103023 Share on other sites More sharing options...
thedarkwinter Posted October 3, 2006 Share Posted October 3, 2006 are you outputting anything on purpose?sometimes if there is an empty line after the [color=blue]?>[/color] and the end of the file is creates this problemdoes that help?cheers,tdw Quote Link to comment https://forums.phpfreaks.com/topic/22868-warning-cannot-modify-header/#findComment-103025 Share on other sites More sharing options...
alexcrosson Posted October 3, 2006 Author Share Posted October 3, 2006 Well there isn't any empty lines that i can see after the ?> Quote Link to comment https://forums.phpfreaks.com/topic/22868-warning-cannot-modify-header/#findComment-103026 Share on other sites More sharing options...
thedarkwinter Posted October 3, 2006 Share Posted October 3, 2006 ... or before the [color=blue]<?php[/color]if you post the source i can look for the output...tdw Quote Link to comment https://forums.phpfreaks.com/topic/22868-warning-cannot-modify-header/#findComment-103033 Share on other sites More sharing options...
wildteen88 Posted October 3, 2006 Share Posted October 3, 2006 You have output being made around line 18 in users.phpPost lines 13 to 23 here from users.php Quote Link to comment https://forums.phpfreaks.com/topic/22868-warning-cannot-modify-header/#findComment-103079 Share on other sites More sharing options...
saiko Posted October 4, 2006 Share Posted October 4, 2006 add <?ob_start();then at the endob_end_flush();?> Quote Link to comment https://forums.phpfreaks.com/topic/22868-warning-cannot-modify-header/#findComment-103608 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.