Re: Problems with headers

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

 



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

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