filedownload and output buffering

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

 



hi all,
i have a small script which shows some information inside a html table
and then pushes a file to save on to users desktop.

but with the following code it download the file and stay without
outputting the html table to browser.

i tried with out put buffering functions, but still no luck (it seems
i'm not clear about those functions yet..). could somebody please help
me on this?

many thanks


~viraj



<?php

function my_callback($content) {
       header('Content-type: application/binary; charset=iso-8859-1');
       header("Expires: 0");
       header("Cache-Control: must-revalidate, post-check=0,pre-check=0");
       header("Pragma: public");
   	header("Content-Disposition: attachment; filename=\"Test.url\"");
		$content .= "[InternetShortcut]\r\n" .
			 "URL=http://192.168.1.71/\r\n"; .
			 "IDList=" .
			 "IconFile=http://192.168.1.71/favicon.ico\r\n"; .
			 "IconIndex=1\r\n" .
            "[{000214A0-0000-0000-C000-000000000046}]\r\n" .
            "Prop3=19,2\r\n";

       return $content;
}


ob_start('my_callback');
getBody();
ob_end_flush();

function getBody()
{
   ?>
<html>
<head>
   <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
</head>
<body>
   <table cellspacing="0" cellpadding="0" width="780" align="center"
border="1">
       <tbody>
           <tr>
               <td class="outerBorder" valign="top" width="780">Some
information goes here..</td>
           </tr>
       </tbody>
   </table>
</body>
</html>
   <?php
}

?>

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