Re: Problems with headers
| From: | Graham Anderson | Date: | Thu, 22 Sep 2005 04:50:23 +0000 |
| Subject: | Re: Problems with headers | ||
| References: | 1 2 3 4 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-222968@lists.php.net to get a copy of this message | ||
I checked that too :(
No spaces in the <?php line
I am running PHP Version 4.4.0
Out of curiosity, I removed the line:
$xml .= '<?quicktime type="application/x-qtskin"?>'."\n";
and got the same error message
Is this one of those situations for ob_start ?
Kind of bizarre to my Newbie mind
<?php
$quote = "\"";
$xml = '';
$xml .= '<?xml version="1.0"?>'."\n";
$xml .= '<?quicktime type="application/x-qtskin"?>'."\n";
$xml .= '<skin>'."\n";
$xml .= '<movie src=' . $quote. "../../fonovisa.mov" . $quote. '/>'."\n"; $xml .= '<contentregion src=' .$quote. "../images/mask.gif" . $quote. '/>'."\n"; $xml .= '<dragregion src=' . $quote. "../images/drag.gif" . $quote. '/>'."\n";$xml .= '</skin>'; header('Content-Type: video/quicktime'); header ("Content-Length: ".strlen($xml)); echo $xml; ?> I am still getting the :
On Sep 21, 2005, at 7:46 PM, Stephen Leaf wrote:<b>Warning</b>: Cannot modify header information - headers already sent by (output started at /home/www/siren/siren/fonovisa/skintest/Library/php/ fonovisa_simple.php:1) in <b>/home/www/siren/siren/fonovisa/skintest/Library/php/ fonovisa_simple.php</b> on line <b>12</b><br />
On Wednesday 21 September 2005 09:34 pm, Graham Anderson wrote: it doesn't look like there is anything wrong with your code. what you might check however is, is there a space or a newline before <?php _nothing_ should come before <?phpthanks Chris :) I changed the spaces but am still getting the same output errors: <b>Warning</b>: Cannot modify header information - headers already sent by (output started at /home/www/siren/siren/fonovisa/skintest/Library/php/ fonovisa_simple.php:1) in <b>/home/www/siren/siren/fonovisa/skintest/Library/php/ fonovisa_simple.php</b> on line <b>11</b><br /> <br /> <b>Warning</b>: Cannot modify header information - headers already sent by (output started at /home/www/siren/siren/fonovisa/skintest/Library/php/ fonovisa_simple.php:1) in <b>/home/www/siren/siren/fonovisa/skintest/Library/php/ fonovisa_simple.php</b> on line <b>12</b><br /> Because I am echoing the $xml string AFTER the header info, I would assume the headers would work ? Is there some way to ensure that the headers come first ? many thanks g <?php $quote = "\""; $xml = ''; $xml .= '<?xml version="1.0"?>'."\n"; $xml .= '<?quicktime type="application/x-qtskin"?>'."\n"; $xml .= '<skin>'."\n"; $xml .= '<movie src=' . $quote. "../../fonovisa.mov" . $quote. '/>'."\n"; $xml .= '<contentregion src=' .$quote. "../images/mask.gif" . $quote. '/>'."\n"; $xml .= '<dragregion src=' . $quote. "../images/drag.gif" . $quote. '/>'."\n"; $xml .= '</skin>'; header('Content-Type: video/quicktime'); //took out a space header ("Content-Length: ".strlen($xml)); // added a space echo $xml; ?> On Sep 21, 2005, at 7:25 PM, Chris Shiflett wrote:-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.phpGraham Anderson wrote:Even though I am defining Content-type as 'video/quicktime', the output is still text/html Also, Content-Length is not outputting properly either :([snip]header('Content-Type: video/quicktime'); header ("Content-Length:".strlen($xml));You have a superfluous space in your Content-Type header, and you're missing a space in your Content-Length header. Those two need to share. :-) Your other error is due to output being generated prior to the header() calls. Hope that helps. Chris -- Chris Shiflett Brain Bulb, The PHP Consultancy http://brainbulb.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php