Re: Problems with headers

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Graham Anderson wrote:
> No spaces in the <?php line

I think the problem is a line before the <?php line:

> <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 />

Applying this to the code you've shown us, I get the following line numbers:

> 1.
> 2.  <?php
> 3.  $quote = "\"";
> 4.  $xml = '';
> 5.  $xml .= '<?xml version="1.0"?>' . "\n";
> 6.  $xml .= '<?quicktime type="application/x-qtskin"?>' . "\n";
> 7.  $xml .= '<skin>' . "\n";
> 8.  $xml .= '<movie src=' . $quote . "../../fonovisa.mov" . $quote
>     . '/>' . "\n";
> 9.  $xml .= '<contentregion src=' . $quote . "../images/mask.gif" .
>     $quote . '/>' . "\n";
> 10. $xml .= '<dragregion src=' . $quote . "../images/drag.gif" .
>     $quote . '/>' . "\n";
> 11. $xml .= '</skin>';
> 12. header('Content-Type: video/quicktime');
> 13. header("Content-Length: ".strlen($xml));
> 14. echo $xml;
> 15. ?>

If I'm right, then the problem is that you have output prior to calling the header() function, exactly as the error says. Remove the first line, and your problem might go away.

By the way, it's unnecessary to make your strings that hard to read - variables are interpreted in double-quoted strings, and double quotes don't need to be escaped inside single-quoted strings. For example:

8.  $xml .= '<movie src="../../fonovisa.mov" />' . "\n";

or

8.  $xml .= "<movie src=\"../../fonovisa.mov\" />\n";

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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux