You are here: Re: [PHP] Problems with headers « PHP « IT news, forums, messages
Re: [PHP] Problems with headers

Posted by Chris Shiflett on 10/03/78 11:27

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/

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация