Here is a small code which I want to run . <?php $url="http://www.domaintools.com/msn.com"; copy ($url,"c://misc.txt"); ?> Error Warning: copy(http://www.domaintools.com/msn.com) [function.copy]: failed to open stream: HTTP request failed! HTTP/1.0 404 Not Found in PHPDocument1 on line 4 Help me
You can't open a remote file using this. You could use something like file_get_contents to get the page and then file_put_contents (or fwrite) to write it to a text file.
This can't work, here's one of the methods how you can do it. <?php $file = file_get_contents("http://www.domaintools.com/msn.com"); $fp = fopen("c://misc.txt", "w+"); fwrite($fp, $file); fclose($fp); ?> PHP: