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@email.com", "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
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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.