page Break

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
witcos
Forum Newbie
Posts: 2
Joined: Tue May 12, 2009 8:41 am

page Break

Post by witcos »

hi to all
actually am trying to create a word document with some content(dynamic content) it goes more than 3 pages ... my problem here is i need a page break between the content.. here is my code

Code: Select all

 
$data .="<table width=75% align=center border=0><tr><td>".$final_data."</td></tr></table>";
     
 
    echo $data;
     
 
    $filename  = $quate_type.".doc";
    
    //$filename = str_replace('&nbsp;','',$filename);  
    
    
         
    $fh        = fopen($filename, 'w') or die("can't open file");
 
    $fwrite    = fwrite($fh,$data);
   
   header("Content-Transfer-Encoding: 8bit");
 
   header("Content-Description: File Transfer");
 
   header("Content-Type: application/text/html;");
 
   header("Content-Disposition: attachment; filename=\"" . basename($filename) . "\""); 
 
any one help me out
Last edited by Benjamin on Tue May 12, 2009 11:34 am, edited 1 time in total.
Reason: Added [code=php] tags.
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: page Break

Post by requinix »

1. You're using HTML. HTML by itself does not have page breaks.
2. The .doc extension is misleading. Use .htm or .html.
3. The MIME type is "text/html". Drop the "application" part.
Post Reply