I am unable to fix this task.Can you please help me.
It is working only for text data.But, not working for webpage content.
For text data, Can you please check it in
http://www.celltonet.com/urltodoc4.php
Enter these urls http://www.php.net , http://www.microsoft.com[I am using comma seperator between urls.] in text box and click on "Create Doc".
For webpage,Can you please check it in
http://www.celltonet.com/urltodoc.php
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.
How to display second page conetent in doc file?
How to convert urls to docs
Moderator: General Moderators
Re: How to convert urls to docs
This post is essentially useless without showing the code that is creating the docs, and grabbing the data.
Pointing out what does what, and what you are having problems with and what you have tried.
Pointing out what does what, and what you are having problems with and what you have tried.
Re: How to convert urls to docs
My code is
$str1=trim($_REQUEST['urls']);
$str=explode(",",$str1);
for($i=0;$i<count($str);$i++) {
$handle = fopen(trim($str[$i]), "r");
$content= stream_get_contents($handle);
$myarray[]=$content;
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');
$str1=trim($_REQUEST['urls']);
$str=explode(",",$str1);
for($i=0;$i<count($str);$i++) {
$handle = fopen(trim($str[$i]), "r");
$content= stream_get_contents($handle);
$myarray[]=$content;
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');