Re: How to convert urls to docs

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

 



Hi,

In the line: fwrite($fp, "\x0C\r\n");
\x0C denotes form feed character. In word, this renders as a new page and 
that page will be a form. 
If you need to display one url per line. \r\n is enough.

FYI, 
\"   Quotation mark
\0   Null (=\x00; ASCII NUL)
\\   Backslash
\b   Backspace (=\x08; ASCII BS)
\f   Form feed (=\x0C; ASCII FF)
\n   Newline (=\x0A; ASCII LF)
\r   Carriage return (=\x0D; ASCII CR)
\t   Tab (=\x09; ASCII HT)

Plus.you do not need to give the absolute paths for files, i.e. 
/home2/celltone/public_html/urltodoc.doc. Relative paths will work. 
fopen('urltodoc.doc', 'w');

Regards,
Manda Krishna Srikanth
http://www.krishnasrikanth.com

php-objects@xxxxxxxxxxxxxxx wrote on 03/17/2008 10:43:11 PM:

> Hi Experts,
> 
> I need to convert urls to documents.
> 
> Can you please check it in http://www.celltonet.com/urltodoc.php
> 
> In the above page, add
> 
> http://www.yahoo.com 
> 
> http://www.google.com
> 
> in text box.Then click on "create doc".It opens one document file 
> with seperate urls in each page.I am receving one extra page at the 
> end of the document.
> 
> Can you please check my code once
> 
> $str=trim($_REQUEST['urls']);// getting urls
> $fp = fopen("/home2/celltone/public_html/urltodoc.doc", 'w+');
> $str=explode("http://www",$str);
> for($i=1;$i<count($str);$i++) {
> fwrite($fp,"http://www".$str[$i]);
> if($i!=(count($str)))
> fwrite($fp, "\x0C\r\n");
> }
> fwrite($fp, $str);
> fclose($fp); 
> header('Content-type: application/msword');
> header('Content-Disposition: attachment; filename="urltodoc.doc"');
> readfile('/home2/celltone/public_html/urltodoc.doc'); 
> 
> One more doubt is
> 
> For example, if I put the yahoo site, the whole page of the site 
> should appear in the doc. How can i do like that.
> 
> Thanks,
> Gangadhar
> 
=====-----=====-----=====
Notice: The information contained in this e-mail
message and/or attachments to it may contain 
confidential or privileged information. If you are 
not the intended recipient, any dissemination, use, 
review, distribution, printing or copying of the 
information contained in this e-mail message 
and/or attachments to it are strictly prohibited. If 
you have received this communication in error, 
please notify us by reply e-mail or telephone and 
immediately and permanently delete the message 
and any attachments. Thank you




[Non-text portions of this message have been removed]


[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Soap]     [Kernel Newbies]     [Yosemite]     [Yosemite Campsites]

  Powered by Linux