Jump to content

Headers


sphinx

Recommended Posts

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

Link to comment
https://forums.phpfreaks.com/topic/252906-headers/
Share on other sites

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.

Link to comment
https://forums.phpfreaks.com/topic/252906-headers/#findComment-1296624
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.