Printing to a buffer

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

 



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

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