You are here: Printing to a buffer « PHP « IT news, forums, messages
Printing to a buffer

Posted by Todd Cary on 11/13/05 00:31

My client's new shared server does not allow printing to a file, so I
want my print statement to print to a buffer, then I'll send it to the
user via Headers. This does not work since "print" does no go to the
buffer, or at least appears not to: I get the errors from the header
statements;

<?
ob_start;
print "This is a test<bf>";
$buf = ob_get_contents();
$len = strlen($buf);
ob_end_clean();
header("Content-type: application/text");
header("Content-Length: $len");
header("Content-Disposition: inline; filename=Sfyc.html");
print($buf);
?>

Todd

 

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

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