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

Posted by Rasmus Lerdorf on 10/11/02 11:27

Graham Anderson wrote:
> <?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;
> ?>

Wow, that is nasty. There is probably a syntax error in there. Use a
heredoc in cases like this. Something like this:

$xml = <<< EOB
<?xml version="1.0"?>
<?quicktime type=...
....
EOB;

Much less likely to make mistakes this way since you don't need to
escape anything (except $) and you can still use variables in the block
of text.

-Rasmus

 

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

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