Warning: Cannot modify header information ...

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
zura
Forum Newbie
Posts: 9
Joined: Mon Oct 17, 2011 1:04 am

Warning: Cannot modify header information ...

Post by zura »

Header(); does not works. Warning: Cannot modify header information - headers already sent by (output started at /home/sanikidz/domains/...).

Code: Select all


<?php
ob_start();
$nomeri = $_POST['operator'].$_POST['cellular'];
$messageText = $_POST['message'];
$e = "http://smsc.ru/sys/send.php?login=zura&psw=1111&phones=".$nomeri."&mes=".$messageText;
header("Location: $e");
if ($e == "true") echo "was sent!";
ob_end_flush();
?>
Thanks for help.
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Re: Warning: Cannot modify header information ...

Post by Christopher »

You probably have a space or return before the opening <?php. Why do you have the output buffering calls around that code? They are not needed.
(#10850)
Post Reply