Re: [Hyderabad PHP Group] How to convert urls to docs

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

 



Hi,

If i enter these urls  http://www.php.net,http://www.microsoft.com in text box  and click on "Create Doc".I am receving content for first url only i.e http://www.php.net But, i am not getting second page content.
 
Can you please check it in 
 
http://www.celltonet.com/urltodoc.php
 
How to display second page conetent in doc files?
 
Can you please check my code once
 
$str1=trim($_REQUEST['urls']);
$str=explode(",",$str1);
for($i=0;$i<count($str);$i++) {
$handle = fopen($str[$i], "rb");
$myarray[]= stream_get_contents($handle);
fclose($handle);
}
$mystring = implode("\x0C", $myarray);
file_put_contents("urltodoc.doc", $mystring);
header('Content-type: application/msword');
header('Content-Disposition: attachment; filename="urltodoc.doc"');
readfile('urltodoc.doc');
 
Can you please help me.I strucked on it.
 
Thanks,
Gangadhar


----- Original Message ----
From: gangadhara prasad <ngprasad20@xxxxxxxxx>
To: hyd-phpug <hyd-phpug@xxxxxxxxxxxxxxx>; php-objects <php-objects@xxxxxxxxxxxxxxx>
Sent: Monday, 17 March, 2008 10:43:11 PM
Subject: [Hyderabad PHP Group] How to convert urls to docs

Hi Experts,
 
I need to convert urls to documents.
 
Can you please check it in http://www.celltone t.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



Did you know? You can CHAT without downloading messenger. Click here 
 


      Unlimited freedom, unlimited storage. Get it now, on http://help.yahoo.com/l/in/yahoo/mail/yahoomail/tools/tools-08.html/

[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