sphinx Posted December 10, 2011 Share Posted December 10, 2011 hello, I'm using this code: <?php if (isset($_REQUEST['email'])) { $name = $_REQUEST['name'] ; $email = $_REQUEST['email'] ; $code = $_REQUEST['code'] ; $from = $email; mail("[email protected]", "Winner request id: $name - code: $code", "From:" . $from); } $headers = "From:" . $from; header('Location: index.php?done'); ?> And I'm getting: Warning: Cannot modify header information - headers already sent by (output started at /home/site/public_html/config.php:10) in /home/site/public_html/send.php on line 13 This worked before. Many thanks Quote Link to comment https://forums.phpfreaks.com/topic/252906-headers/ Share on other sites More sharing options...
xyph Posted December 10, 2011 Share Posted December 10, 2011 It's hard to say. There's some output being sent, but I don't know where. Perhaps the mail function is outputting an error? The output starting on line 10 leads me to believe this is the case. If you suppress errors using the @ symbol, does it work? @mail(....); View the source, and check for output Also, the text editor you use may have added a byte order mark to the file, which is considered output. This wouldn't make sense though, as the output apparently starts on line 10. Quote Link to comment https://forums.phpfreaks.com/topic/252906-headers/#findComment-1296624 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.