title: Warning: Header may not contain more than a single header, new line detected
body: <p>I have a question about PHP error. I went through other similar questions, and apply it, but I still have a problem like this, so I am asking it. </p>
  
  <p>Situation is like this. There is an text box called special instruction; if I put just one line it is fine to work, but if I put more than one line it causes problem like this. I put urlencode(str) to solve the problem, but it is still showed up. What do I need to change? T.T</p>
  
  <p>error message is "Warning: Header may not contain more than a single header, new line detected."</p>
  
  <pre><code>if($_POST['Submit'] == 'Submit Order'){
      $today = date('D M dY');
      $to_time = date('h:i a');
      $hours = substr($to_time, 0, -6);
      $minutes = substr($to_time, -5, 2);
      $seconds = substr($to_time, -2);
      $total_seconds = ($hours * 3600) + ($minutes * 60) + $seconds;
  
      $date123 = $_POST['day'];
      $date_post = date('D M dY',$date123);
  
      $time_post = $_POST['time']; 
      $hours_post   = substr($time_post, 0, -6);
      $minutes_post = substr($time_post, -5, 2);
      $seconds_post = substr($time_post, -2);
      $total_seconds_post = ($hours_post * 3600) + ($minutes_post * 60) + $seconds_post;
  
      $tip_amo = $_POST["tip_amount"];
      $deliv_mails = $_POST["deliv_mails"];
      $coupon_no = $_POST['coupon_no'];
      $minorder = $_POST['minorder'];
      $subtotal_amount = $_POST['subtotal_amount'];
      $payment_type = $_POST['payment_type'];
      $comments = addslashes($_POST['comments']);
      $coupon_code = $_REQUEST["coupon_code"];
      $customer_comments = get_field(CART,"additional_text","session_id='$sessionid'");
  
      if($comments == ''){
          $comments1 = $customer_comments;
      }else{
          $comments1 = $comments;
      }
  
      if($time_post!='') {
          if($today==$date_post){
              $query = [
                  'day' =&gt; $date123,
                  'time' =&gt; $time_post,
                  'coupon_no' =&gt; $coupon_no,
                  'minorder' =&gt; $minorder,
                  'subtotal_amount' =&gt; $subtotal_amount,
                  'payment_type' =&gt; $payment_type,
                  'comments' =&gt; $comments1,
                  'coupon_code' =&gt; $coupon_code,
                  'tip_amount' =&gt; $tip_amo,
                  'deliv_mails' =&gt; $deliv_mails,
                  'd' =&gt; $address
              ];
              header('Location: details_info_order.php?' . http_build_query($query));
              exit;
          }else{
              $query = [
                  'day' =&gt; $date123,
                  'time' =&gt; $time_post,
                  'coupon_no' =&gt; $coupon_no,
                  'minorder' =&gt; $minorder,
                  'subtotal_amount' =&gt; $subtotal_amount,
                  'payment_type' =&gt; $payment_type,
                  'comments' =&gt; $comments1,
                  'coupon_code' =&gt; $coupon_code,
                  'tip_amount' =&gt; $tip_amo,
                  'deliv_mails' =&gt; $deliv_mails,
                  'd' =&gt; $address
              ];
              header('Location: details_info_order.php?' . http_build_query($query));
              exit;
          }
      }
  }
  </code></pre>
  
  <blockquote>
    <p>Warning: Header may not contain more than a single header, new line detected. in /home4/mikehan2/public_html/mikehan7/final_checkout_block.php on line 64</p>
  </blockquote>
  
  <p>it is the exact error message.</p>